diff options
| author | Quentin Aristote <quentin@aristote.fr> | 2022-04-16 17:42:38 +0200 |
|---|---|---|
| committer | Quentin Aristote <quentin@aristote.fr> | 2022-04-16 17:42:38 +0200 |
| commit | 0d1f7118f12ad2e85581b387d12b6f5cd032422f (patch) | |
| tree | ec586d62476d3c0fb8442d68ec441c21fee0135f | |
| parent | c865080bd6c77ddb13545e21e17f0eb3e407111c (diff) | |
clean shellHook after running it so that it does not run again when using nix-shell
| -rw-r--r-- | default.nix | 14 |
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; }) |
