diff options
author | Matthew Bauer <mjbauer95@gmail.com> | 2021-05-17 15:07:00 -0500 |
---|---|---|
committer | Matthew Bauer <mjbauer95@gmail.com> | 2021-05-17 15:07:00 -0500 |
commit | 5fd8cf76676a280ae2b7a86ddabc6b14b41ebfe5 (patch) | |
tree | 6bcd4f03d3ae68018534a0b60ea71e2cc27ff55a | |
parent | bd6cf25952a42afabea822141798566e0f0583b3 (diff) |
Source bashrc first in nix develop
~/.bashrc should be sourced first in the rc script so that PATH &
other env vars give precedence over the bashrc PATH.
Also, in my bashrc I alias rm as:
alias rm='rm -Iv'
To avoid running this alias (which shows ‘removed '/tmp/nix-shell.*'),
we can just prefix rm with command.
-rw-r--r-- | src/nix/develop.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nix/develop.cc b/src/nix/develop.cc index 2b64d9a31..10f843651 100644 --- a/src/nix/develop.cc +++ b/src/nix/develop.cc @@ -395,7 +395,7 @@ struct CmdDevelop : Common, MixEnvironment if (verbosity >= lvlDebug) script += "set -x\n"; - script += fmt("rm -f '%s'\n", rcFilePath); + script += fmt("command rm -f '%s'\n", rcFilePath); if (phase) { if (!command.empty()) @@ -414,7 +414,7 @@ struct CmdDevelop : Common, MixEnvironment } else { - script += "[ -n \"$PS1\" ] && [ -e ~/.bashrc ] && source ~/.bashrc;\n"; + script = "[ -n \"$PS1\" ] && [ -e ~/.bashrc ] && source ~/.bashrc;\n" + script; if (developSettings.bashPrompt != "") script += fmt("[ -n \"$PS1\" ] && PS1=%s;\n", shellEscape(developSettings.bashPrompt)); if (developSettings.bashPromptSuffix != "") |