Trace that stateVersion is not set, but it is?

I had also this issue when using NixOps. I did add the builtins.trace and the message appeared, but not the warning. I am using flakes and the only source is NixOS 22.11. I’ll update here if the warning comes back.

Edit: Nevermind, in my case, it was because I am using a systemd container and didn’t set system.stateVersion inside it.

1 Like

If you do see it again, you can get a trace with NIX_ABORT_ON_WARN=1 + --impure.

The trace will be rather verbose, but is very likely to tell you which option was getting evaluated when the warning was encountered.

1 Like

:man_facepalming: I completely forgot about the container issue. That should have been among the first things I asked about.

Ah, interesting. Could be that the trace is from some systemd container that did not get updated the last time I did a rebuild. Because of that I would not have seen some trace, am I right?
I will observe and report back if something comes up again!

No, updated or not, the nix code would still have been evaluated, generating the trace.

1 Like