Skip to content

Commit 2b4e3fa

Browse files
committed
nix-daemon: source nix-profile-daemon.sh only once
On my system (Ubuntu 24.04 with nix installed using https://zero-to-nix.com/), I noticed that my PATH contained multiple times the following entries: /home/thomas/.nix-profile/bin /nix/var/nix/profiles/default/bin Fix it by inserting a missing `export`, to make sure `nix-daemon.sh` is really only executed once.
1 parent 3f13cc0 commit 2b4e3fa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scripts/nix-profile-daemon.sh.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Only execute this file once per shell.
22
# This file is tested by tests/installer/default.nix.
33
if [ -n "${__ETC_PROFILE_NIX_SOURCED:-}" ]; then return; fi
4-
__ETC_PROFILE_NIX_SOURCED=1
4+
export __ETC_PROFILE_NIX_SOURCED=1
55

66
NIX_LINK=$HOME/.nix-profile
77
if [ -n "${XDG_STATE_HOME-}" ]; then

0 commit comments

Comments
 (0)