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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Setup NIX_PATH correctly in nix-profile-daemon #1664
Conversation
/cc @grahamc Does this look like a good idea? The issue right now is Nix 1.12 will not recognize the path that’s setup by default (nixpkgs is not found) so something like: nix build nixpkgs.hello Will fail |
What would happen if root would remove its channel? |
656f246
to
c449af8
Compare
scripts/nix-profile-daemon.sh.in
Outdated
@@ -50,5 +50,5 @@ if test -w $HOME; then | |||
fi | |||
|
|||
export NIX_SSL_CERT_FILE="@localstatedir@/nix/profiles/default/etc/ssl/certs/ca-bundle.crt" | |||
export NIX_PATH="@localstatedir@/nix/profiles/per-user/root/channels" | |||
export NIX_PATH="${NIX_PATH:+$NIX_PATH:}nixpkgs=@localstatedir@/nix/profiles/per-user/root/channels/nixpkgs:@localstatedir@/nix/profiles/per-user/root/channels" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prepending the previous NIX_PATH
is not a good idea because it will cause it to grow every time a (login) subshell is created.
This is the same I was thinking, but I think the rest of the patch is good.
…On Wed, Apr 4, 2018, 5:21 AM Eelco Dolstra ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In scripts/nix-profile-daemon.sh.in
<#1664 (comment)>:
> @@ -50,5 +50,5 @@ if test -w $HOME; then
fi
export ***@***.***@/nix/profiles/default/etc/ssl/certs/ca-bundle.crt"
-export ***@***.***@/nix/profiles/per-user/root/channels"
+export ***@***.***@***@***.***@/nix/profiles/per-user/root/channels"
Prepending the previous NIX_PATH is not a good idea because it will cause
it to grow every time a (login) subshell is created.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1664 (review)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAErrD4ud1NFCpybt7bAg1mIktFxBzbdks5tlJB_gaJpZM4QSO9Z>
.
|
We need nixpkgs to be set in NIX_PATH for Nix 1.12 to work correctly
Okay removed that line. Note that it is still in nix-profile.sh.in: https://github.com/NixOS/nix/blob/master/scripts/nix-profile.sh.in#L54-L57 |
This should only get sourced once anyway, if we export __ETC_PROFILE_NIX_SOURCED paths can be extended without introducing duplicates. |
Polluting the environment with variables like |
Pinging |
We need nixpkgs to be set in NIX_PATH for Nix 1.12 to work correctly.