From c343d52944c1c67c87a069c8b793a21b197bbe2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Soko=C5=82owski?= Date: Thu, 11 Apr 2024 16:18:45 +0300 Subject: [PATCH] fix(nix)_: add USER var when sourcing profile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jakub SokoĊ‚owski --- nix/scripts/source.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/nix/scripts/source.sh b/nix/scripts/source.sh index 5272bebd9..3f8b61981 100755 --- a/nix/scripts/source.sh +++ b/nix/scripts/source.sh @@ -11,6 +11,7 @@ source_nix_profile() { if [[ "${NIX_INSTALL_TYPE}" == "multi" ]]; then source "/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh" elif [[ "${NIX_INSTALL_TYPE}" == "single" ]]; then + export USER="${USER:-$(id -nu)}" # Missing in Docker. source "${HOME}/.nix-profile/etc/profile.d/nix.sh" elif [[ "${NIX_INSTALL_TYPE}" == "nixos" ]]; then echo "Sourcing profile not necessary on NixOS!" >&2