fix(nix)_: add USER var when sourcing profile

Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
Jakub Sokołowski 2024-04-11 16:18:45 +03:00
parent 9509fddd40
commit c343d52944
No known key found for this signature in database
GPG Key ID: FE65CD384D5BF7B4
1 changed files with 1 additions and 0 deletions

View File

@ -11,6 +11,7 @@ source_nix_profile() {
if [[ "${NIX_INSTALL_TYPE}" == "multi" ]]; then if [[ "${NIX_INSTALL_TYPE}" == "multi" ]]; then
source "/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh" source "/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh"
elif [[ "${NIX_INSTALL_TYPE}" == "single" ]]; then elif [[ "${NIX_INSTALL_TYPE}" == "single" ]]; then
export USER="${USER:-$(id -nu)}" # Missing in Docker.
source "${HOME}/.nix-profile/etc/profile.d/nix.sh" source "${HOME}/.nix-profile/etc/profile.d/nix.sh"
elif [[ "${NIX_INSTALL_TYPE}" == "nixos" ]]; then elif [[ "${NIX_INSTALL_TYPE}" == "nixos" ]]; then
echo "Sourcing profile not necessary on NixOS!" >&2 echo "Sourcing profile not necessary on NixOS!" >&2