-
-
Notifications
You must be signed in to change notification settings - Fork 14.3k
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
treewide: rewrite stateVersion docs (again), clean up some stateVersion usages (again) #263744
Conversation
70a87ec
to
08ea01b
Compare
08ea01b
to
26fbdff
Compare
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.
Docs LGTM, also replacing the absolute paths with modulesPath
. Not sure about the other details, so please wait for actual maintainers.
26fbdff
to
c708386
Compare
r? @colemickens for Azure stuff, @mkg20001 for LXD stuff |
To be honest, I haven't touched that stuff in years, and have less than no incentive to now. My last attempt was out-of-tree, which is probably what I'd recommend going forward. In fact, I'd recommend deprecating and planning to remove the Azure stuff from the tree, but I have no idea if folks are using any of it. Sorry I don't have a better answer. |
Ideally we'd want to build _all_ the stateVersions, but this is probably still better?
We should really have the user set it, or at least have a warning.
Use modulesPath so we don't have to magically rewrite paths in activation script, set stateVersion to the one this was built with (which should approximate "first install")
Just like we do for the other live images
Hopefully this way we don't confuse people into thinking you have to set it to 21.05.
3053b58
to
9338ea0
Compare
9338ea0
to
e014d55
Compare
conditional on the first version of NixOS you've installed (encoded in `stateVersion`), instead of | ||
simply always using the latest one. | ||
|
||
Note that this generally only affects applications that can't upgrade their data automatically - |
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.
Even if an application can upgrade automatically its data, often it can not downgrade the data, making rollbacks obsolete. I understood stateVersion
also as a warning to make sure I create backups otherwise I would not be able to rollback.
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.
The seems too tangential to include here, as it's not really about stateVersion, just another aspect of how nixos interacts with state. This description is already long enough that a fair chunk of people won't read it all.
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 also not about backups really - automated upgrades happen in nixpkgs all the time without stateVersion bumps.
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.
👍 for lxd
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 commented on the comment. Changes there then potentially need to be mirrored to the option docs.
# This option defines the first version of NixOS you have installed on this particular machine, | ||
# and is used to maintain compatibility with data not managed by NixOS configuration (e.g. databases) | ||
# that was created by applications running on older NixOS versions. | ||
# | ||
# Most users should NEVER change this value after the initial install, for any reason, | ||
# even if you've upgraded your system. | ||
# | ||
# This value does NOT affect the Nixpkgs version your packages and OS are pulled from, | ||
# so changing it will NOT upgrade your system. | ||
# | ||
# This value being lower than the current NixOS release does NOT mean your system is | ||
# out of date, out of support, or vulnerable. | ||
# | ||
# Do NOT change this value unless you have manually inspected all the changes it would make to your configuration, | ||
# and migrated your data accordingly. | ||
# | ||
# For more information, see `man configuration.nix`. |
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 think this is good and clear. A few thoughts:
-
"This option defines the first version of NixOS you have installed on this particular machine" kinda blurs the difference between the current install and previous installs of nixos on the same machine. It’s hopefully not a confusion anyone runs into, but it seems like an unneccessary confusion. Maybe "This option is neccessary to remember the version of NixOS used during initial install on this particular machine."?
-
"with data not managed by NixOS configuration" this is confusing. The data is not generated from NixOS configuration, but file location, services, etc. are managed by NixOS configuration. We are looking for a beginner friendly term for "stateful data", right? How about simply "compatibility with application data (e.g. databases) that was created by older NixOS versions."
-
For my personal taste, this comment is too long. I would confine more of the warnings into the option documentation. That’s exactly why the comment previously said "a) just leave this, it’s fine and b) before changing read the docs". In the end I have no clue what works better for users. Just saying, that we maybe need a different solution before half of configuration.nix is an essay about stateVersion.^^
-
Why drop the the nixos.org link? I assume for many users it is the more natural interface to read options than the man-page which is arguably only semi-made for this.
I would love to see my first two points considered somehow, the second two are nice to have.
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 get the problem, but I think "initial install" can be misread mostly the same way. I can't really think of a good way to phrase this to make it clear we mean "the first version of this install" without using "install" is a noun, which is confusing.
-
Yes, that was the idea. I think I like your version, though "application data" is technically never created by NixOS, it's created by applications - but that's nitpicky and not relevant to the target audience for this comment.
-
Originally it was intro, 3 points, see also. Now it's 4 points (with number 3 being added on suggestion from @tejing), and I think this is also my upper limit for how many points it should have. I'd like to condense it more, but I think more points that are punchier individually is better than less points that don't hit as hard.
-
No particular reason, I think it just got lost in the sauce. I'll put it back.
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.
If this were a book I would be very opposed to the one paragraph - one sentence policy. I think I would probably just pack the points 2 to 5 in one paragraph. That way we have three paragraphs "What is this, what to do, further reading". But that’s really just my intuition. You can leave it as is.
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 actually intentionally separated these into individual lines, because I want them to scan as individual points. For a book, you'd probably want to write the whole thing very differently. This is basically our equivalent to the "this is not a place of honor" messages.
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.
Applied [2] and [4]. Still thinking of a good way to phrase [1].
e014d55
to
31acd3b
Compare
how about something like this for the config comment?
|
Not scary enough, IMO. |
This sentence is good. It's the most intuitive single-line answer to "what does this option do" I've seen yet. I still think we should keep the punchy later lines, but the first paragragh could be changed to:
|
31acd3b
to
be93a15
Compare
Did you mean to remove the nixos manual url in that last force-push? |
Hopefully this version is clearer. Also tried to make it less technical.
Match the comment in nixos-generate-config and add some more details for the curious.
be93a15
to
424b0ce
Compare
No, fixed. |
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.
Yeah, I like where the wording is at now.
Description of changes
This is as actionable (or really NON-actionable) as I can make it sound, I think.
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)