Guest User

Untitled

a guest
May 27th, 2016
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. { nixpkgs ? import <nixpkgs> {}
  2. , compiler ? "default"
  3. , withHoogle ? true
  4. }:
  5.  
  6. let
  7.  
  8. inherit (nixpkgs) pkgs;
  9.  
  10. packageSet = if compiler == "default"
  11. then pkgs.haskellPackages
  12. else pkgs.haskell.packages.${compiler};
  13.  
  14. haskellPackages =
  15. if withHoogle
  16. then packageSet.override {
  17. overrides = (self: super: {
  18. ghc = super.ghc // { withPackages = super.ghc.withHoogle; };
  19. ghcWithPackages = self.ghc.withPackages;
  20. });
  21. }
  22. else packageSet;
  23.  
  24. f = import ./default.nix;
  25.  
  26. drv = haskellPackages.callPackage f {};
  27.  
  28. in
  29.  
  30. if pkgs.lib.inNixShell then drv.env else drv
Add Comment
Please, Sign In to add comment