From 45752fc633d0991b320aa3f900a5a737a38c8f4c Mon Sep 17 00:00:00 2001 From: Anton-Latukha Date: Sun, 1 Nov 2020 19:56:58 +0200 Subject: [PATCH 1/4] shell.nix: use Haskell notation, use explicit attrs Since variadic (...) attr passing does not work in Nix - the least of evils - is to expicitly state the few attrs affecting the `shell.nix`. --- shell.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/shell.nix b/shell.nix index 0e50343..ed4e26b 100644 --- a/shell.nix +++ b/shell.nix @@ -1 +1,5 @@ -{} @ attrs: (import ./. attrs).env +attrs@ + { compiler ? "ghc8101" + , withHoogle ? true + }: +(import ./. attrs).env From b8cc8dfdeef9afb6adc79d28d4793174b3571cfb Mon Sep 17 00:00:00 2001 From: Anton-Latukha Date: Sun, 1 Nov 2020 20:52:57 +0200 Subject: [PATCH 2/4] default.nix: set Hoogle to false by default (true is in shell.nix) --- default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/default.nix b/default.nix index 2a980b7..095aa42 100644 --- a/default.nix +++ b/default.nix @@ -76,8 +76,8 @@ , executableNamesToShellComplete ? [ "hnix" ] -# Include Hoogle into derivation -, withHoogle ? true +# Include Hoogle executable and DB into derivation +, withHoogle ? false # Nix by default updates and uses locally configured nixpkgs-unstable channel From ad078200f935bb1b7977e2cf5eaeec9007dd55e3 Mon Sep 17 00:00:00 2001 From: Guillaume Maudoux Date: Wed, 18 Nov 2020 11:53:36 +0100 Subject: [PATCH 3/4] Work around nix default values behavior --- shell.nix | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/shell.nix b/shell.nix index ed4e26b..501ae7b 100644 --- a/shell.nix +++ b/shell.nix @@ -1,5 +1,6 @@ -attrs@ - { compiler ? "ghc8101" - , withHoogle ? true - }: -(import ./. attrs).env +attrs@{...}: +let defaultAttrs = { + withHoogle = true; + compiler = "ghc8101"; +}; +in (import ./. (defaultAttrs // attrs)).env From a277ad4857c6f48e17fd093298d9bf0fecf17ef8 Mon Sep 17 00:00:00 2001 From: Anton-Latukha Date: Wed, 18 Nov 2020 22:26:03 +0200 Subject: [PATCH 4/4] shell.nix: add explanation why explicit defaults set --- shell.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/shell.nix b/shell.nix index 501ae7b..4f35b64 100644 --- a/shell.nix +++ b/shell.nix @@ -1,5 +1,6 @@ attrs@{...}: let defaultAttrs = { + # Defaults are put in this form deliberately. Details: #748 withHoogle = true; compiler = "ghc8101"; };