Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ### default.nix ###
- { nixpkgs ? import <nixpkgs> { config.allowUnfree = true; }
- , compiler ? "default"
- , doBenchmark ? false
- }:
- let
- inherit (nixpkgs) pkgs;
- thepackage = import ./thepackage.nix;
- haskellPackages = if compiler == "default"
- then pkgs.haskellPackages
- else pkgs.haskell.packages.${compiler};
- variant = if doBenchmark then pkgs.haskell.lib.doBenchmark else pkgs.lib.id;
- in
- variant (haskellPackages.callPackage thepackage {})
- ### shell.nix ###
- { nixpkgs ? import <nixpkgs> { config.allowUnfree = true; }
- , compiler ? "default"
- , doBenchmark ? false
- }:
- let
- inherit (nixpkgs) pkgs;
- drv = import ./default.nix { inherit nixpkgs compiler; };
- drvWithTools = pkgs.haskell.lib.addBuildDepends drv (with pkgs; [
- cabal-install haskellPackages.ghcid
- ]);
- in
- if pkgs.lib.inNixShell then drvWithTools.env else drvWithTools
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement