-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Fix root channels location #8073
Conversation
@@ -91,6 +91,7 @@ jobs: | |||
- run: exec sh -c "nix-instantiate -E 'builtins.currentTime' --eval" | |||
- run: exec zsh -c "nix-instantiate -E 'builtins.currentTime' --eval" | |||
- run: exec fish -c "nix-instantiate -E 'builtins.currentTime' --eval" | |||
- run: exec bash -c "nix-channel --update && nix-env -iA nixpkgs.hello && hello" |
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.
Does this make the test impure (i.e. fetching the latest nixpkgs from the network)?
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.
It's currently broken (because there's no channel added by the installer), but yes. The thing is that if we want to test that the installer works fine, this is an important code path to test, and I'm not sure how we can make it more pure. Is there a way to pin a channel to a specific version?
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.
Is there a way to pin a channel to a specific version?
So a 5mins investigation shows that nix-channel --add https://releases.nixos.org/nixos/unstable/nixos-23.05pre466020.60c1d71f2ba nixpkgs
seems to do the trick. Is that a stable url that we can rely on? And is that an acceptable way of pinning the channels version?
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.
Do we we still want this since the "mock channel" test?
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.
I'd rather keep this since the “mock channel” ones don't run on gha. But I'm OK with removing it if that's preferred
(Maybe you're still celebrating Pi Day, but there is no Nix 3.14 (or 3.13) as mentioned in your PR body, yet 😆 ) |
Oops :) Thanks, fixed |
d7a1fe1
to
ee94515
Compare
Make sure that all the code paths use the same one, and that the backwards-compatibility measures are probably in place when needed
ee94515
to
717e81d
Compare
These are proper documentation of the API, so they deserve to be here
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/2023-03-23-nix-team-meeting-minutes-43/26758/1 |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/tweag-nix-dev-update-46/26872/1 |
Motivation
Fix for #7984. Pin the location of root's channels directory.
Note that this might break the use-cases where
root
doesn't have write-accessto
/nix/var/nix
(for instance if/nix
is a read-only share). But since thiswas already broken before #5226 I assume it's
not really a problem.
I'd like someone to double-check that this doesn't cause any migration issue, but I don't think so since:
/nix/var/nix/profiles/per-user/root/channels
was really the public endpoint for the profiles, so we're just restoring it.The implementation should be good, but I'm keeping this as a draft while I find a way to test it a bit more.
Checklist for maintainers
Maintainers: tick if completed or explain if not relevant
tests/**.sh
src/*/tests
tests/nixos/*
Priorities
Add 👍 to pull requests you find important.