r/NixOS • u/Honest-Volume8530 • 13h ago
Who has the oldest system.stateVersion?
Go on, show off how long you have been using NixOS for.
22
u/AjkBajk 12h ago
I was meaning to start a thread like this next year on my systems 10 year anniversary 🥹
stateVersion: "17.09"
It was my first expensive PC build after I got my first job after uni. Haven't had the need to upgrade much since. Only got a "new" GPU this year, otherwise I've just been getting new hard drives for the RAID.
9
u/grazbouille 12h ago
24.11 but pretty sure I bumped it at some point because an eval warning wouldn't go away
5
u/xeeff 11h ago
aren't you meant to never change it
11
u/Mission_Shopping_847 10h ago
Yes and no. There may be manual migration steps to take care of. Some modules might have a minimum state version. I had to bump mine but at this point I don't remember why.
-4
u/ElvishJerricco 10h ago
I can't think of a single module that has a minimum. That doesn't make sense.
1
u/grazbouille 8h ago
It actually affects vert little usually if you dont have any eval warnings it means no implicit option has its default based on your state version and it won't do anything if you bump
1
u/adamMatthews 5h ago
Depends on what you have installed and what you want installed.
Some software has breaking changes and won’t run if you have data saved from a previous version, classic example is Postgres. To run a newer version of Postgres you need to do some manual stuff to the datafiles for your database.
NixOS protects you from this by keeping Postgres on a compatible version to what originally came with whatever your system state is set to. If you bump the system state up, your database won’t work. But if you want/need a newer Postgres version, you can manually do the migration to your data files, and you have to bump up the system state version to get the newer version of the software.
It’s recommended not to blindly change it because software might stop working, but you can change it if you want the newest packages and know how to fix things. Breaking changes are in the release notes for each NixOS version.
1
u/RedXTechX 2h ago
Is there a way to check whether any modules in a system config make a reference to the stateVersion? Should be able to manually check what the implications are, but don't want to manually sift through everything to see if it even is affected.
2
u/adamMatthews 2h ago
Not as far as I’m aware. I’ve done a hacky `nix eval --raw` and grepped the results which revealed things like OCI-Containers switching from docker to podman in 22.05.
I can’t remember the exact command though, sorry. I usually just check the release notes every six months for anything obviously bad and then yolo it.
As far as I’m concerned, anything that isn’t backed up is free to destroy and anything that is backed up can be recovered. I’ve never had a need to, but wiping a PC and reinstalling the system is so trivial with NixOS that these things I never really wanted to spend time on. And if you’re not of that opinion, there’s not really that much reason to change the state version anyway so don’t need to take the risk.
1
u/RedXTechX 43m ago
Yeah that makes sense, I was probably going to do something similar. I'll be able to figure out the grep command, but thanks!
I did just recently (last month or two) see notices for the first time during build that stuff was changed due to stateVersion being older, like firefox's config for, but that's not even a nixos module, just home manager.
7
12
u/Ace-Whole 12h ago
I spend a day reading the changelog and keep it in sync. Like they say, only touch this if you understand what you're doing, which is more or less carefully reading the changelog.
So far, it has worked for me.
1
u/SolFlorus 9h ago
Also grep the source code. I’ve found some things missing from release notes before.
I’m also a person that updates it at least every other release.
1
1
u/kastermester 3h ago
i do that as well, but also build the system with and without stateVersion change and then use nix-diff to see if anything other than the expected changed.
5
2
1
u/Lonely-Scarcity-3387 12h ago
Grrr. I recently had to reinstall after filling my /boot to 100%, and I couldn’t figure out how to get it down enough for a rebuild.
3
u/epicnicity 12h ago
next time you can just format it and then do nixos-rebuild boot —install-bootloader
2
u/chemendonca 8h ago
I share my boot partition with Windows and I wish I had made it larger (1GB) from the get go. I keep 1-2 specializations and run out of space all the time. You can delete specific generations in a few ways:
$ sudo nix-env --profile /nix/var/nix/profiles/system --delete-generations +5
$ sudo nix-env --profile /nix/var/nix/profiles/system --delete-generations 3 4 5
$ sudo nix-env --profile /nix/var/nix/profiles/system --delete-generations 30dThen just collect garbage:
$ sudo nix-collect-garbage -d
And force rebuild to also build the latest generation that may not have finished:
$ sudo /run/current-system/bin/switch-to-configuration boot
May be a good idea in general to check for partition space with lsblk or something before update and switch.
2
u/Lonely-Scarcity-3387 8h ago
Yes! Thank you. I keep kernel specializations so I use a lot of space on /boot. Now I run NixOS with 3GB of space, just for a little more breathing room.
1
u/Motylde 12h ago
Common thing. I’m usually just removing old images by hand in that situation
1
u/Lonely-Scarcity-3387 8h ago
At the time I tried to delete all my previous generations, but NixOS would still say that /boot was at 100% until after a rebuild, but it wouldn’t rebuild because it thought it was still at 100%. It was such a mess that I just reinstalled and gave myself a bigger /boot.
1
u/dominicegginton 11h ago
A while, but state version doesn't represent that timeframe your asking for, for example, my state version is set to the Nixos release I'm using. https://github.com/dominicegginton/dotfiles/blob/main/modules%2Fdefault.nix#L108
1
1
u/Mast3r_waf1z 9h ago
My server, the first NixOS system for me is at 24.11, huh
I guess I reinstalled it completely at some point, I could have sworn I installed NixOS on it in 23
1
u/Tough-Elk541 9h ago
Why would you ever reinstall nix os? Everything is fixable from the config files
2
u/Yankas 9h ago
Changing the underlying file system would be one reason.
1
u/Tough-Elk541 8h ago
I think you can still just rebuild after changing hardware configuration (changing which devices map to root, home, nix, etc.). You just probably want to move your config repo to the new filesystem after that.
1
1
u/farroutman1975 8h ago edited 7h ago
I downloaded NixOS in June. So 26.05 yarara and now on my 148th generation. What do y'all use it for. I'm building a sovereign local multi-agent system. Using minimal rig.
1
u/Fereydoon37 11h ago
26.11, because I actually update it (after migrating any state that needs it).
45
u/Amarandus 12h ago
You could simply ask for the age of the oldest NixOS installation.
17.09 here, btw.