Help Wanted: Updating Nix as part of nixos-rebuild --switch

So this issue is now opened for multiple months and is wreaking havoc on my deployments.

I have tried to have a go at it, but it seems i cannot find a nice way to do it. It seems like a circular dependency to me, and i do not know enough about the whole nixos-rebuild script.

Would it be possible to get some help from someone that knows it to explore the steps needed ?

2 Likes

An idea would be to set restartIfChanged to false in the systemd service nix and then add a check just for whether nix changed somewhere at the beginning of https://github.com/NixOS/nixpkgs/blob/78956495de9930857962467b50de066e98eeb10b/nixos/modules/system/activation/switch-to-configuration.pl and restart it before anything else

But Iā€™m really just guessing