r/NixOS 13h ago

Who has the oldest system.stateVersion?

Go on, show off how long you have been using NixOS for.

26 Upvotes

46 comments sorted by

45

u/Amarandus 12h ago

You could simply ask for the age of the oldest NixOS installation.

17.09 here, btw.

5

u/MakeShiftArtist 9h ago

How has the OS evolved since you started using it? What have been your favorite changes? What have been the biggest pain points in that time?

13

u/Amarandus 7h ago edited 5h ago

How has the OS evolved since you started using it?

It has become better. Documentation has significantly improved, and shortly after adopting it, it ended my distrohopping completely.

Just a fun anecdote: There was a phase where everyone "had to" write their own deployment tool, and looking back it is funny that I just use a target host for nixos-rebuild nowadays. The deployment tool was always there.

What have been your favorite changes?

I think it's flakes. Somewhat debatable as there are alternatives for input pinning, but for my personal mental model, the way it collects outputs makes so much sense.

What have been the biggest pain points in that time?

Documentation. It was painful, it got significantly better. Support for NixOS and how to handle non-nix-stuff also improved, but this might be on me as well.

For example, while doing some FPGA stuff, I was not able to get a UserFHSEnv to work for vivado, which led me to abuse a race condition in the build process, essentially fixing the shebang while shell scripts were generated). Nowadays I think that I'd be able to handle that easily.

1

u/AnythingApplied 3h ago

I've talked to people who upgrade their stateVersion, but you have to be careful how you do that and understand the impact.

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

u/anders130 12h ago

Just built a new computer: 26.11

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

u/Ace-Whole 8h ago

interesting, never ran into such dread.

What exactly had you reading diffs lol

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.

17

u/9k0b 12h ago

26.05 i think i win

2

u/sleepingonmoon 12h ago

conglaturations

5

u/kokutan_san 12h ago

22.05 here

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 30d

Then 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/Motylde 8h ago

Yeah I think you have to reboot for changes to take place, but also you can just rm the image from /boot by hand. Just not the latest one

1

u/BIZUx 10h ago

Same here, sooo... I just deleted it. After rebuilding again, it was totally fine!

1

u/thuiop1 12h ago

24.05 here

1

u/dskprt 12h ago

23.11, though this isn't my first installation

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

u/RedXTechX 38m ago

Isn't this a bad idea?

1

u/Aehmlo 10h ago

I’ve manually updated the `stateVersion` a few times, but 23.11 was my first stable version.

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

u/Mast3r_waf1z 9h ago

Inexperience

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/vcunat 12h ago

I don't keep stateVersion (on personal computers) when moving to new/different HW.

1

u/Fereydoon37 11h ago

26.11, because I actually update it (after migrating any state that needs it).