diff options
| author | Emily <vcs@emily.moe> | 2024-09-12 10:46:25 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-09-12 10:46:25 +0100 |
| commit | 1380edcdf3e218f7d68f75e1d5c6ef00eaf913bc (patch) | |
| tree | d45f0fffb5e899852f041d0e67f0b63e5b533b11 /modules/programs | |
| parent | f4f18f3d7229845e1c9d517457b7a0b90a38b728 (diff) | |
| parent | 6ad463a76421022de6762e6f50128febb970dcfc (diff) | |
Merge pull request #1071 from antoineco/zsh/fix-children-shells-init
Backport Zsh fpath child shell and nounset fixes from NixOS
Diffstat (limited to 'modules/programs')
| -rw-r--r-- | modules/programs/zsh/default.nix | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/modules/programs/zsh/default.nix b/modules/programs/zsh/default.nix index 58a3155..7574f8e 100644 --- a/modules/programs/zsh/default.nix +++ b/modules/programs/zsh/default.nix @@ -124,14 +124,13 @@ in # This file is read for all shells. # Only execute this file once per shell. - # But don't clobber the environment of interactive non-login children! - if [ -n "$__ETC_ZSHENV_SOURCED" ]; then return; fi - export __ETC_ZSHENV_SOURCED=1 + if [ -n "''${__ETC_ZSHENV_SOURCED-}" ]; then return; fi + __ETC_ZSHENV_SOURCED=1 # Don't execute this file when running in a pure nix-shell. if test -n "$IN_NIX_SHELL"; then return; fi - if [ -z "$__NIX_DARWIN_SET_ENVIRONMENT_DONE" ]; then + if [ -z "''${__NIX_DARWIN_SET_ENVIRONMENT_DONE-}" ]; then . ${config.system.build.setEnvironment} fi @@ -153,7 +152,7 @@ in # This file is read for login shells. # Only execute this file once per shell. - if [ -n "$__ETC_ZPROFILE_SOURCED" ]; then return; fi + if [ -n "''${__ETC_ZPROFILE_SOURCED-}" ]; then return; fi __ETC_ZPROFILE_SOURCED=1 ${concatStringsSep "\n" zshVariables} |
