summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorAntoine Cotten <hello@acotten.com>2024-09-12 17:37:56 +0000
committerAntoine Cotten <hello@acotten.com>2024-09-12 17:37:56 +0000
commit953d02ba5958df017d9682f727d10a75cb8a0391 (patch)
tree57304fa3758e1b0e299db02e6602283598f55679 /modules
parent1380edcdf3e218f7d68f75e1d5c6ef00eaf913bc (diff)
{bash,zsh}: remove nix-shell early return in /etc/{bashrc,zshenv}
The condition does not match the comment, and therefore not the original intention. It currently returns early in *any* type of Nix shell, not just pure ones, including 'nix develop'. Besides being unnecessary, this check prevents Nix shells from functioning properly. For instance, it causes the initialization of the Zsh fpath to be skipped, which is critical. The fact that the user is unable to opt out of this behaviour makes this an ever bigger problem since /etc/zshenv is being loaded unconditionally by Zsh. For reference, NixOS does not perform such check, and apparently never did.
Diffstat (limited to 'modules')
-rw-r--r--modules/programs/bash/default.nix3
-rw-r--r--modules/programs/zsh/default.nix3
2 files changed, 0 insertions, 6 deletions
diff --git a/modules/programs/bash/default.nix b/modules/programs/bash/default.nix
index 2e27ff9..3abb3e8 100644
--- a/modules/programs/bash/default.nix
+++ b/modules/programs/bash/default.nix
@@ -55,9 +55,6 @@ in
if [ -n "$__ETC_BASHRC_SOURCED" -o -n "$NOSYSBASHRC" ]; then return; fi
__ETC_BASHRC_SOURCED=1
- # Don't execute this file when running in a pure nix-shell.
- if [ "$IN_NIX_SHELL" = "pure" ]; then return; fi
-
if [ -z "$__NIX_DARWIN_SET_ENVIRONMENT_DONE" ]; then
. ${config.system.build.setEnvironment}
fi
diff --git a/modules/programs/zsh/default.nix b/modules/programs/zsh/default.nix
index 7574f8e..bfbfc59 100644
--- a/modules/programs/zsh/default.nix
+++ b/modules/programs/zsh/default.nix
@@ -127,9 +127,6 @@ in
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
. ${config.system.build.setEnvironment}
fi