srid / nixos-flake

A flake-parts module to manage NixOS and macOS machines, along with home-manager support, in a unified fashion.
https://community.flake.parts/nixos-flake
MIT License
175 stars 19 forks source link

Templates throw a `system.stateVersion is not set` warning #13

Closed bestlem closed 1 year ago

bestlem commented 1 year ago

When I created a flake for mac and linux nix flake check gives me

trace: warning: system.stateVersion is not set, defaulting to 23.05. Read why this matters on https://nixos.org/manual/nixos/stable/options.html#opt-system.stateVersion.

I note that in https://github.com/srid/nixos-config you do set it insystems/darwin.nix and systems/hetzner/ax101.nix - although first is to 4 and other is to a release number.

srid commented 1 year ago

That's a warning, not an error (failure):

srid on pce /tmp/ad
❯ nix flake init -t github:srid/nixos-flake
wrote: /tmp/ad/flake.nix

srid on pce /tmp/ad
❯ nix flake check
warning: creating lock file '/tmp/ad/flake.lock'
warning: unknown flake output 'nixos-flake'
trace: warning: system.stateVersion is not set, defaulting to 23.05. Read why this matters on https://nixos.org/manual/nixos/stable/options.html#opt-system.stateVersion.
warning: unknown flake output 'homeModules'

srid on pce /tmp/ad took 12s
❯ echo $?
0

I should perhaps update the documentation saying that users must set the stateVersion. Ref: https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion

bestlem commented 1 year ago

And update as per my PR - Set to the highest now as you can assume you have no old systems to keep current.

srid commented 1 year ago

14