diff options
author | Yann Herklotz <git@yannherklotz.com> | 2019-07-21 13:34:32 +0200 |
---|---|---|
committer | Yann Herklotz <git@yannherklotz.com> | 2019-07-21 13:34:32 +0200 |
commit | 2c709fd34ec189dd4815061307194c7d5944da28 (patch) | |
tree | 911943ed0e8fbf05d1a60e07e43c392b893839bd /shell.nix | |
parent | 003203b33ebac04ee6fc933d444584bb1e81f250 (diff) | |
download | verismith-2c709fd34ec189dd4815061307194c7d5944da28.tar.gz verismith-2c709fd34ec189dd4815061307194c7d5944da28.zip |
Add the shell.nix
Diffstat (limited to 'shell.nix')
-rw-r--r-- | shell.nix | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..733234f --- /dev/null +++ b/shell.nix @@ -0,0 +1,25 @@ +{ compiler ? "default", doBenchmark ? false }: + +let + config = { + packageOverrides = pkgs: rec { + haskellPackages = pkgs.haskellPackages.override { + overrides = haskellPackagesNew: haskellPackagesOld: rec { + hedgehog-fn = haskellPackagesNew.callPackage ./nix/hedgehog-fn.nix {}; + tomland = haskellPackagesNew.callPackage ./nix/tomland.nix {}; + parser-combinators = haskellPackagesNew.callPackage ./nix/parser-combinators.nix {}; + }; + }; + }; + }; + pkgs = import <nixpkgs> { inherit config; }; + + 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.callPackage (import ./.) {}); +in + if pkgs.lib.inNixShell then drv.env else drv |