From d57842487d86d710bdbf83b9c2bbe1fa8c1dd6e2 Mon Sep 17 00:00:00 2001 From: Yann Herklotz Date: Sat, 27 Jul 2019 11:16:17 +0200 Subject: Make the nix build more concise --- shell.nix | 26 +------------------------- 1 file changed, 1 insertion(+), 25 deletions(-) (limited to 'shell.nix') diff --git a/shell.nix b/shell.nix index 733234f..910b922 100644 --- a/shell.nix +++ b/shell.nix @@ -1,25 +1 @@ -{ 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 { 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 +(import ./. {}).env -- cgit