summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQuentin Aristote <quentin@aristote.fr>2022-04-16 17:42:38 +0200
committerQuentin Aristote <quentin@aristote.fr>2022-04-16 17:42:38 +0200
commit0d1f7118f12ad2e85581b387d12b6f5cd032422f (patch)
treeec586d62476d3c0fb8442d68ec441c21fee0135f
parentc865080bd6c77ddb13545e21e17f0eb3e407111c (diff)
clean shellHook after running it so that it does not run again when using nix-shell
-rw-r--r--default.nix14
1 files changed, 10 insertions, 4 deletions
diff --git a/default.nix b/default.nix
index ec1f0ed..c12ca85 100644
--- a/default.nix
+++ b/default.nix
@@ -1,4 +1,4 @@
-{ pkgs, settings }:
+{ pkgs, settings }:
let
lib = pkgs.lib;
@@ -7,8 +7,14 @@ let
modules = [ settings ./modules ] ++ defaultSettings;
specialArgs.pkgs = pkgs;
};
-in
-pkgs.mkShell ({
- inherit (module.config)
+ clean-hooks = hookList:
+ lib.mapAttrs (name: value:
+ if lib.elem name hookList then ''
+ ${value}
+ export "${name}"=
+ '' else
+ value);
+in pkgs.mkShell ({
+ inherit (clean-hooks [ "shellHook" ] module.config)
inputsFrom buildInputs nativeBuildInputs shellHook exitHook;
})