FS#79516 - [nix] inconsistent `user.environment.conf` with upstream
Attached to Project:
Arch Linux
Opened by Bryan Lai (bryango) - Wednesday, 30 August 2023, 09:34 GMT
Last edited by Toolybird (Toolybird) - Thursday, 31 August 2023, 02:13 GMT
Opened by Bryan Lai (bryango) - Wednesday, 30 August 2023, 09:34 GMT
Last edited by Toolybird (Toolybird) - Thursday, 31 August 2023, 02:13 GMT
|
Details
Description:
I believe the packaged `user.environment.conf`: https://gitlab.archlinux.org/archlinux/packaging/packages/nix/-/blob/main/user.environment.conf is originally included to ease the user setup process. However, since then the upstream installation has improved and `user.environment.conf` is now outdated. Additional info: * package version(s): `nix: 2.17.0-1` - incorrect `NIX_PATH`: the default user channel is changed to be `~/.nix-defexpr/channels -> ~/.local/state/nix/profiles/channels`. This works _without_ setting `NIX_PATH`. Our `user.environment.conf` sets `nixpkgs=/nix/var/nix/profiles/per-user/$USER/channels/nixpkgs` instead, which is deprecated some time ago. The new standard is documented here: https://nixos.org/manual/nix/stable/command-ref/nix-env#user-channel-link `NIX_PATH` fallback is documented here: https://nixos.org/manual/nix/stable/command-ref/env-common.html#env-NIX_PATH The wrong `NIX_PATH` will cause the new standard `~/.local/state/nix/profiles/channels` to be ignored and trigger warnings. - unnecessary `PATH`: this is now automatically set via `/etc/profile.d/nix-daemon.sh`: https://github.com/NixOS/nix/blob/master/scripts/nix-profile-daemon.sh.in. Setting `PATH` again results in duplicated entries. Resolution: In our `user.environment.conf`: https://gitlab.archlinux.org/archlinux/packaging/packages/nix/-/blob/main/user.environment.conf, - remove `PATH`. This should just work. - remove `NIX_PATH`. This is a bit subtle; I am not sure if removing this will break old installs that have not yet migrated to the current standard. If this is the case, then one can keep `NIX_PATH` but include `$HOME/.local/state/nix/profiles/channels`. I think it's best to leave everything to the upstream `/etc/profile.d/nix-daemon.sh`. I have removed `user.environment.conf` entirely with `~/.config/environment.d/nix-daemon.conf -> /dev/null` and things have been working smoothly for me. |
This task depends upon
Closed by Toolybird (Toolybird)
Thursday, 31 August 2023, 02:13 GMT
Reason for closing: Duplicate
Additional comments about closing: FS#78828
Thursday, 31 August 2023, 02:13 GMT
Reason for closing: Duplicate
Additional comments about closing:
FS#78828? It all seems very closely related so this is more than likely a dupe.and I don't understand why that didn't show up...
Please feel free to close it if it's considered duplicated. The additional information is that setting `PATH` is also unnecessary. I will also comment there.
Update: Awesome! After the project & category change the other bug is now visible to me. I guess this is a fallout of the community / extra merge.