NixOS on a headless system

I want to install NixOS on a server that I’m accessing via SSH only. Does this work without any specific settings, or do I have to change something? I’m particularly wondering whether GRUB has a timeout by default or whether it will always wait for a user choosing a configuration.

No problem, grub will automatically select a generation and boot :+1:

2 Likes

No problem, grub will automatically select a generation and boot :+1:

Note that this loses the ability to boot into a previous configuration; I think on many servers there is some mechanism allowing watchdogs, and some people have managed to setup auto-rollback on boot failure, but you would need to investigate and adapt the solutions to the specific situation.

(I haven’t found any of these solutions integrated into NixOS)

Interesting, do you have any pointer to any of those integrations?

there is some mechanism allowing watchdogs, and some people have managed to setup auto-rollback on boot failure

Interesting, do you have any pointer to any of those integrations?

A lot of time ago @Infinisil has helpfully mentioned a timed link to a talk even more time ago mentioning this:

systemd-boot has a mechanism for this, which I guess could be hooked up in nixpkgs (here) without too much work.

1 Like

I’m generally not worried about unsuccessful boots, since I have the ability to boot into a rescue system. However, being able to boot into previous configurations would be important. That said, isn’t there a way to force booting into a previous configuration via NixOS?

I’m generally not worried about unsuccessful boots, since I have the ability to boot into a rescue system. However, being able to boot into previous configurations would be important. That said, isn’t there a way to force booting into a previous configuration via NixOS?

Even from a rescue system you can just edit the grub.cfg to change the default and call it done.

From NixOS there are some fancier ways using the parameters (I guess just «boot») to switch-to-configuration script of each generation, these invocations will also remove the menu options that have been garbage-collected since the last regeneration.

1 Like

Thanks, very interesting