summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorMichael Hoang <Enzime@users.noreply.github.com>2024-11-09 08:22:06 +0000
committerGitHub <noreply@github.com>2024-11-09 08:22:06 +0000
commit3224bb2f7c998448e4eb9b5df93195af2e268a30 (patch)
tree1008eeff7bd060f1314224ac840d93524fd513ed /modules
parent2fbf4a8417c28cf45bae6e6e97248cbbd9b78632 (diff)
parent5fbb7b7637307c89e52d7e73ed6c848353bda6a0 (diff)
Merge pull request #1154 from Samasaur1/zshenv-rcs
zsh: only run shell initialization in /etc/zshenv when RCs are enabled
Diffstat (limited to 'modules')
-rw-r--r--modules/programs/zsh/default.nix18
1 files changed, 10 insertions, 8 deletions
diff --git a/modules/programs/zsh/default.nix b/modules/programs/zsh/default.nix
index a9ffbd8..c6ec917 100644
--- a/modules/programs/zsh/default.nix
+++ b/modules/programs/zsh/default.nix
@@ -136,16 +136,18 @@ in
if [ -n "''${__ETC_ZSHENV_SOURCED-}" ]; then return; fi
__ETC_ZSHENV_SOURCED=1
- if [ -z "''${__NIX_DARWIN_SET_ENVIRONMENT_DONE-}" ]; then
- . ${config.system.build.setEnvironment}
- fi
+ if [[ -o rcs ]]; then
+ if [ -z "''${__NIX_DARWIN_SET_ENVIRONMENT_DONE-}" ]; then
+ . ${config.system.build.setEnvironment}
+ fi
- # Tell zsh how to find installed completions
- for p in ''${(z)NIX_PROFILES}; do
- fpath=($p/share/zsh/site-functions $p/share/zsh/$ZSH_VERSION/functions $p/share/zsh/vendor-completions $fpath)
- done
+ # Tell zsh how to find installed completions
+ for p in ''${(z)NIX_PROFILES}; do
+ fpath=($p/share/zsh/site-functions $p/share/zsh/$ZSH_VERSION/functions $p/share/zsh/vendor-completions $fpath)
+ done
- ${cfg.shellInit}
+ ${cfg.shellInit}
+ fi
# Read system-wide modifications.
if test -f /etc/zshenv.local; then