shell.nix (887B)
1 { nixpkgs ? import <nixpkgs> {}, compiler ? "default", doBenchmark ? false }: 2 3 let 4 5 inherit (nixpkgs) pkgs; 6 7 f = { mkDerivation, base, bound, lib, llvm-codegen 8 , recursion-schemes 9 }: 10 mkDerivation { 11 pname = "haskell"; 12 version = "0.1.0.0"; 13 src = ./.; 14 isLibrary = false; 15 isExecutable = true; 16 executableHaskellDepends = [ 17 base bound llvm-codegen recursion-schemes 18 ]; 19 license = "unknown"; 20 mainProgram = "haskell"; 21 }; 22 23 haskellPackages = if compiler == "default" 24 then pkgs.callPackage ./pkgs {} 25 else pkgs.haskell.packages.${compiler}; 26 27 variant = if doBenchmark then pkgs.haskell.lib.doBenchmark else pkgs.lib.id; 28 29 drv = variant (haskellPackages.callPackage f {}); 30 31 in 32 33 if pkgs.lib.inNixShell then drv.env else drv