mirror of
https://github.com/NixOS/nix.git
synced 2025-11-08 19:46:02 +01:00
installer: prepend nix paths to shell config files instead of appending
Some distribution will stop evaluating the shell config file if they are not running in an interactive shell. As we append the nix paths to the end of the file, they will not be evaluated. We better prepend the nix paths to the shell config files to be sure that once nix is installed, nix path will be available in any shell. Note that this is already the case for the detsys installer script for a while: https://github.com/DeterminateSystems/nix-installer/pull/148 Possibly related errors: https://github.com/NixOS/nix/issues/8061 https://github.com/NixOS/nix/pull/6628 https://github.com/NixOS/nix/issues/2587
This commit is contained in:
parent
07b96c1d14
commit
a408bc3e30
1 changed files with 5 additions and 3 deletions
|
|
@ -915,9 +915,11 @@ configure_shell_profile() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -e "$profile_target" ]; then
|
if [ -e "$profile_target" ]; then
|
||||||
shell_source_lines \
|
{
|
||||||
| _sudo "extend your $profile_target with nix-daemon settings" \
|
shell_source_lines
|
||||||
tee -a "$profile_target"
|
cat "$profile_target"
|
||||||
|
} | _sudo "extend your $profile_target with nix-daemon settings" \
|
||||||
|
tee "$profile_target"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue