diff options
Diffstat (limited to 'modules/programs')
| -rw-r--r-- | modules/programs/bash/default.nix | 5 | ||||
| -rw-r--r-- | modules/programs/fish.nix | 5 | ||||
| -rw-r--r-- | modules/programs/zsh/default.nix | 8 |
3 files changed, 9 insertions, 9 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 diff --git a/modules/programs/fish.nix b/modules/programs/fish.nix index 6ee5355..470dcac 100644 --- a/modules/programs/fish.nix +++ b/modules/programs/fish.nix @@ -109,8 +109,9 @@ in set fish_function_path ${pkgs.fish-foreign-env}/share/fish-foreign-env/functions $__fish_datadir/functions # source the NixOS environment config - fenv export PATH=${config.environment.systemPath} - fenv source ${config.system.build.setEnvironment} + if [ -z "$__NIX_DARWIN_SET_ENVIRONMENT_DONE" ] + fenv source ${config.system.build.setEnvironment} + end # clear fish_function_path so that it will be correctly set when we return to $__fish_datadir/config.fish set -e fish_function_path diff --git a/modules/programs/zsh/default.nix b/modules/programs/zsh/default.nix index de90433..4d5559a 100644 --- a/modules/programs/zsh/default.nix +++ b/modules/programs/zsh/default.nix @@ -120,8 +120,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 ${cfg.shellInit} @@ -158,9 +159,6 @@ in if [ -n "$__ETC_ZSHRC_SOURCED" -o -n "$NOSYSZSHRC" ]; then return; fi __ETC_ZSHRC_SOURCED=1 - # Also set to fix `nix run` shells. - __ETC_BASHRC_SOURCED=1 - # history defaults SAVEHIST=2000 HISTSIZE=2000 |
