From a408bc3e30e3e5b7ff61596d1072973679761363 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Roche?= Date: Fri, 19 Sep 2025 13:54:39 +0200 Subject: [PATCH] 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 --- scripts/install-multi-user.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/install-multi-user.sh b/scripts/install-multi-user.sh index 477eb1fd6..450a773e9 100644 --- a/scripts/install-multi-user.sh +++ b/scripts/install-multi-user.sh @@ -915,9 +915,11 @@ configure_shell_profile() { fi if [ -e "$profile_target" ]; then - shell_source_lines \ - | _sudo "extend your $profile_target with nix-daemon settings" \ - tee -a "$profile_target" + { + shell_source_lines + cat "$profile_target" + } | _sudo "extend your $profile_target with nix-daemon settings" \ + tee "$profile_target" fi done