diff options
Diffstat (limited to 'shell.nix')
-rw-r--r-- | shell.nix | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..30c2872 --- /dev/null +++ b/shell.nix @@ -0,0 +1,21 @@ +{ nixpkgs ? import <nixpkgs> {}, compiler ? "default", doBenchmark ? false }: + +let + + inherit (nixpkgs) pkgs; + + haskellPackages = if compiler == "default" + then pkgs.haskellPackages + else pkgs.haskell.packages.${compiler}; + + variant = if doBenchmark then pkgs.haskell.lib.doBenchmark else pkgs.lib.id; + + drv = variant (haskellPackages.callCabal2nix "terminal-scanner" ./. {}); + +in + + pkgs.lib.overrideDerivation drv.env (oldAttrs: { + buildInputs = [ + pkgs.cabal-install + ]; + }) |