From 971748ace9ab126951102ec0434bce7f0ba59821 Mon Sep 17 00:00:00 2001 From: Noam Yorav-Raphael Date: Thu, 19 Sep 2024 07:20:04 +0300 Subject: [PATCH 1/2] nix-profile.sh.in: fix envvar condition (cherry picked from commit 97fffd8765d61571577b621d14b8a03740367458) # Conflicts: # scripts/nix-profile.sh.in --- scripts/nix-profile.sh.in | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/nix-profile.sh.in b/scripts/nix-profile.sh.in index e868399b1..82488c172 100644 --- a/scripts/nix-profile.sh.in +++ b/scripts/nix-profile.sh.in @@ -1,11 +1,16 @@ # This file is tested by tests/installer/default.nix. -if [ -n "$HOME" ] && [ -n "$USER" ]; then +if [ -n "${HOME-}" ] && [ -n "${USER-}" ]; then # Set up the per-user profile. +<<<<<<< HEAD NIX_LINK="$HOME/.nix-profile" if [ -n "${XDG_STATE_HOME-}" ]; then NIX_LINK_NEW="$XDG_STATE_HOME/nix/profile" +======= + if [ -n "${NIX_STATE_HOME-}" ]; then + NIX_LINK="$NIX_STATE_HOME/profile" +>>>>>>> 97fffd876 (nix-profile.sh.in: fix envvar condition) else NIX_LINK_NEW="$HOME/.local/state/nix/profile" fi From a69d32d194c8ab168b1113bf36a38c81a9718447 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Sun, 12 Jan 2025 13:15:03 +0100 Subject: [PATCH 2/2] Resolve conflict Some of the code before https://github.com/NixOS/nix/pull/11351 did not have the problem. What remains wasn't all that problematic, but is good to have anyway. --- scripts/nix-profile.sh.in | 5 ----- 1 file changed, 5 deletions(-) diff --git a/scripts/nix-profile.sh.in b/scripts/nix-profile.sh.in index 82488c172..1b73e1de4 100644 --- a/scripts/nix-profile.sh.in +++ b/scripts/nix-profile.sh.in @@ -3,14 +3,9 @@ if [ -n "${HOME-}" ] && [ -n "${USER-}" ]; then # Set up the per-user profile. -<<<<<<< HEAD NIX_LINK="$HOME/.nix-profile" if [ -n "${XDG_STATE_HOME-}" ]; then NIX_LINK_NEW="$XDG_STATE_HOME/nix/profile" -======= - if [ -n "${NIX_STATE_HOME-}" ]; then - NIX_LINK="$NIX_STATE_HOME/profile" ->>>>>>> 97fffd876 (nix-profile.sh.in: fix envvar condition) else NIX_LINK_NEW="$HOME/.local/state/nix/profile" fi