From b366d729d29bbaa46216272a7d6347140df563f5 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Tue, 17 May 2022 14:53:13 -0400 Subject: [PATCH] nix: Parametrize 'project' so withHoogle is used in shell only --- flake.nix | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/flake.nix b/flake.nix index 551f4bc..84b8d5f 100644 --- a/flake.nix +++ b/flake.nix @@ -37,12 +37,14 @@ pkgs.treefmt ]; - project = returnShellEnv: + project = + { returnShellEnv ? false + , withHoogle ? false + }: hp.developPackage { - inherit returnShellEnv; + inherit returnShellEnv withHoogle; name = "haskell-template"; root = ./.; - withHoogle = true; overrides = self: super: with pkgs.haskell.lib; { # Use callCabal2nix to override Haskell dependencies here # cf. https://tek.brick.do/K3VXJd8mEKO7 @@ -62,7 +64,7 @@ { # Used by `nix build ...` packages = { - default = project false; + default = project { }; }; # Used by `nix run ...` apps = { @@ -73,7 +75,7 @@ }; # Used by `nix develop ...` devShells = { - default = project true; + default = project { returnShellEnv = true; withHoogle = true; }; }; # For compatability with older Nix (eg in CI) devShell = inputs.self.devShells.${system}.default;