-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Global vs per-user profiles and channels #8147
base: master
Are you sure you want to change the base?
Conversation
a1baec6
to
54123b0
Compare
304acaa
to
adf8f48
Compare
🎉 All dependencies have been resolved ! |
adf8f48
to
0e1fe69
Compare
221c768
to
d2f2c46
Compare
d2f2c46
to
7d1fc4d
Compare
🎉 All dependencies have been resolved ! |
7d1fc4d
to
2c75e65
Compare
Triaged in the Nix team meeting today Idea approved, assigned to @tomberek
|
708694c
to
963b079
Compare
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/2023-08-18-nix-team-meeting-minutes-80/32081/1 |
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.
Needs a bare-minimum of testing for the existence and sanity checking of the commands. Likely small modifications to the existing profile tests. This should not be a blocker - no need for exhaustiveness beyond existing test coverage.
eg: in user-envs.sh, running --global-profile
seems to give the same results as --user-profile
.
# Query installed: should contain foo-1.0 now (which should be
# executable).
test "$(nix-env -q '*' | wc -l)" -eq 1
test "$(nix-env --user-profile -q '*' | wc -l)" -eq 1
test "$(nix-env --global-profile -q '*' | wc -l)" -eq 0
nix-env -q '*' | grepQuiet foo-1.0
test "$($profiles/test/bin/foo)" = "foo-1.0"
427c5c3
to
fd0a006
Compare
fd0a006
to
8ef788e
Compare
The motivation for this is basically explained in the contribution guide, as guidance on how to design features like this going forward. In short, I think it is confusing for operations acting on the default profile to *always* do something different based on whether the user is regular or root. Instead, this makes there be flags which are (from the vantage point of today) "do the root default" vs "do the regular user" default. This make the situation teachable: we can point to the flags, and the conditional default, as *exactly* what varies between the root and non-root cases. And by manually specifying enough flags, we can ensure those defaults are overridden and Nix will indeed do the same thing (or fail trying). This is similar to the logic behind the supplementary group setting (NixOS#8342), which I also discuss in this new section of the contribution guide as a second example. Instead of creating the default dirs in `getDefaultProfile` (which is a bit odd if the symlink points elsewhere), create the profile dir for the chosen profile in `createGeneration`. That seems more appropriate and keeps the test added in e997512 (where the profiles are deleted but the symlink isn't) working.
8ef788e
to
6a378f5
Compare
Motivation
The motivation for this is basically explained in the contribution guide, as guidance on how to design features like this going forward.
In short, I think it is confusing for operations acting on the default profile to always do something different based on whether the user is regular or root.
Instead, this makes there be flags which are (from the vantage point of today) "do the root default" vs "do the regular user" default. This make the situation teachable: we can point to the flags, and the conditional default, as exactly what varies between the root and non-root cases. And by manually specifying enough flags, we can ensure those defaults are overridden and Nix will indeed do the same thing (or fail trying).
Context
This is similar to the logic behind the supplementary group setting (#8342), which I also discuss in this new section of the contribution guide as a second example.
depends on #8351depends on #8735Checklist 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.