summaryrefslogtreecommitdiff
path: root/modules/programs/bash
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/programs/bash
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/programs/bash')
-rw-r--r--modules/programs/bash/default.nix5
1 files changed, 3 insertions, 2 deletions
diff --git a/modules/programs/bash/default.nix b/modules/programs/bash/default.nix
index ea5afe2..6f5c8e7 100644
--- a/modules/programs/bash/default.nix
+++ b/modules/programs/bash/default.nix
@@ -61,8 +61,9 @@ in
# Don't execute this file when running in a pure nix-shell.
if test -n "$IN_NIX_SHELL"; then return; fi
- export PATH=${config.environment.systemPath}
- ${config.system.build.setEnvironment.text}
+ if [ -z "$__NIX_DARWIN_SET_ENVIRONMENT_DONE" ]; then
+ . ${config.system.build.setEnvironment}
+ fi
# Return early if not running interactively, but after basic nix setup.
[[ $- != *i* ]] && return