Add XDG_DATA_DIRS to nix-profile.sh#2443
Conversation
|
No, I feel that Nix on non-NixOS systems should pollute the user's environment as little as necessary, to minimize the probability that installing a Nix package breaks the host system. (E.g. setting |
This is helpful for locating resources with Nix, especially in unmanaged situations like on macOS or non-NixOS Linux.
d319ec2 to
adc754a
Compare
|
The most common need for this is with qt5 apps where qtbase is in propagated-user-env-pkgs. The qt5 runtime can't find the plugins provided by qt5 base, even when qtbase is installed. It needs to be able to find these plugins in XDG_DATA_DIRS. This leads to a lot of apps in Nixpkgs being nonfunctional to new users. See issue NixOS/nixpkgs#42893. |
Is this still an issue after the wrapQtAppsHook changes? (Assuming every app has been wrapped) |
Not so much, although you can still run into situations when setting XDG_DATA_DIRS helps. Qt is not so important though. |
This is helpful for locating resources with Nix, especially in
unmanaged situations like on macOS or non-NixOS Linux.
Like MANPATH,it should be harmless to have these set when the directory doesn’t
exist. If anyone knows of other variables like this, please mention them
here! We should include as many as possible so things work out-of-the-box.