I have a VM with a minimal nixos and deployed to it with nixops. However when the VM reboots all deployed configuration is lost. I have to deploy again and even have to destroy first to get it working.
Also deploy --force-reboot does not work.
I think my deployment on a Hetzner server does not show this behavior.
I noticed that the unit files in /etc/systemd/system of the deployed services vanish after a reboot. Is this expected behavior?
Turns out, the configuration is not really lost I can activate it manually with
This activates the latest configuration and should make it the default for the next boot.
Any idea why it cannot make it bootable?
Just for context, it is a virtual box VM which I installed manually from the minimal ISO.
It uses normal MBR (not EFI) .
Also watch out for nixos autoupgrades as it does not work with nixops. I ran into this issue several months ago https://github.com/NixOS/nixops/issues/990
Just to follow up and close this thread in a way that someone can learn something from it.
The problem was me. I mixed up the physical server configuration and used settings which led nixops to believe it was deploying to an EFI boot system. Naturally persisting the new configuration in the boot record failed and nix booted automatically into the initial configuration. Setting the correct boot.loader.grub.enable = true; resolved the issue.
I’m just a little surprised that the activation of the new configuration didn’t prompt an error when updating the boot menu failed.