summaryrefslogtreecommitdiff
path: root/modules/environment
diff options
context:
space:
mode:
authorAndrew Childs <lorne@cons.org.nz>2018-10-25 00:30:34 +0900
committerAndrew Childs <lorne@cons.org.nz>2018-10-25 01:00:52 +0900
commit676ef103771aa3fc4b150290294b8ad5610d2750 (patch)
treea208b52ff962a4f0cfc0041cd5f473f6795a07dc /modules/environment
parente6a698a7011487f16dd061d65e36ec330465ed16 (diff)
Unify environment configuration and don't run in child shells
This should enable `nix run` to work under shells like fish and zsh, as well as making child shells not needlessly reset any environment that should be inherited. Implementation adapted from NixOS.
Diffstat (limited to 'modules/environment')
-rw-r--r--modules/environment/default.nix4
1 files changed, 4 insertions, 0 deletions
diff --git a/modules/environment/default.nix b/modules/environment/default.nix
index 6d77cd6..8ba0735 100644
--- a/modules/environment/default.nix
+++ b/modules/environment/default.nix
@@ -184,6 +184,10 @@ in {
};
system.build.setEnvironment = pkgs.writeText "set-environment" ''
+ # Prevent this file from being sourced by child shells.
+ export __NIX_DARWIN_SET_ENVIRONMENT_DONE=1
+
+ export PATH=${config.environment.systemPath}
${concatStringsSep "\n" exportVariables}
# Extra initialisation