Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix logic for default XDG_DATA_DIRS value #9312

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion scripts/nix-profile-daemon.fish.in
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ set __ETC_PROFILE_NIX_SOURCED 1
set --export NIX_PROFILES "@localstatedir@/nix/profiles/default $HOME/.nix-profile"

# Populate bash completions, .desktop files, etc
if test -n "$XDG_DATA_DIRS"
if test -z "$XDG_DATA_DIRS"
# According to XDG spec the default is /usr/local/share:/usr/share, don't set something that prevents that default
set --export XDG_DATA_DIRS "/usr/local/share:/usr/share:/nix/var/nix/profiles/default/share"
else
Expand Down
2 changes: 1 addition & 1 deletion scripts/nix-profile-daemon.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ fi
export NIX_PROFILES="@localstatedir@/nix/profiles/default $NIX_LINK"

# Populate bash completions, .desktop files, etc
if [ -n "${XDG_DATA_DIRS-}" ]; then
if [ -z "$XDG_DATA_DIRS" ]; then
# According to XDG spec the default is /usr/local/share:/usr/share, don't set something that prevents that default
export XDG_DATA_DIRS="/usr/local/share:/usr/share:$NIX_LINK/share:/nix/var/nix/profiles/default/share"
else
Expand Down
2 changes: 1 addition & 1 deletion scripts/nix-profile.fish.in
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ if test -n "$HOME" && test -n "$USER"
set --export NIX_PROFILES "@localstatedir@/nix/profiles/default $HOME/.nix-profile"

# Populate bash completions, .desktop files, etc
if test -n "$XDG_DATA_DIRS"
if test -z "$XDG_DATA_DIRS"
# According to XDG spec the default is /usr/local/share:/usr/share, don't set something that prevents that default
set --export XDG_DATA_DIRS "/usr/local/share:/usr/share:$NIX_LINK/share:/nix/var/nix/profiles/default/share"
else
Expand Down
2 changes: 1 addition & 1 deletion scripts/nix-profile.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ if [ -n "$HOME" ] && [ -n "$USER" ]; then
export NIX_PROFILES="@localstatedir@/nix/profiles/default $NIX_LINK"

# Populate bash completions, .desktop files, etc
if [ -n "${XDG_DATA_DIRS-}" ]; then
if [ -z "$XDG_DATA_DIRS" ]; then
# According to XDG spec the default is /usr/local/share:/usr/share, don't set something that prevents that default
export XDG_DATA_DIRS="/usr/local/share:/usr/share:$NIX_LINK/share:/nix/var/nix/profiles/default/share"
else
Expand Down