Skip to content
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

nixos/version: Only warn about unset stateVersion if used (lite) #207958

Merged

Conversation

roberth
Copy link
Member

@roberth roberth commented Dec 27, 2022

Description of changes

If a configuration does not use services that depend on the stateVersion, it does not need to be set.

This provides an incentive for services not to rely on stateVersion, and not to burden users with this.

Currently, it is still required by some modules, so to make a valid stateVersion-less configuration you'll have to use disabledModules.

This change forms the foundation of #207313, which has breaking changes, while this pr does not.

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 23.05 Release Notes (or backporting 22.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
    • (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • Fits CONTRIBUTING.md.

@dasJ
Copy link
Member

dasJ commented Dec 27, 2022

What about dropping the default altogether?

@roberth
Copy link
Member Author

roberth commented Dec 27, 2022

What about dropping the default altogether?

The default default or the macOS one? The macOS linux builder one seems valuable enough because it adds a bit of explanation.

I'm ok with removing the default from misc/version.nix, but that's a separate change and a separate discussion.

Copy link
Contributor

@Gabriella439 Gabriella439 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Just a few small suggestions

nixos/modules/profiles/macos-builder.nix Outdated Show resolved Hide resolved
nixos/modules/profiles/macos-builder.nix Outdated Show resolved Hide resolved
If a configuration does not use services that depend on the
stateVersion, it does not need to be set.

This provides an incentive for services not to rely on
stateVersion, and not to burden users with this.
roberth and others added 2 commits December 28, 2022 14:38
The `system` argument is usually implied, and not hard to figure out.

Co-authored-by: Gabriella Gonzalez <Gabriel439@gmail.com>
I was considering the broader context of stateVersion, but the
macos builder does not enable documentation, making this paragraph
a distraction.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants