HOWTO: Install NixOS on an OVH dedicated server

Hi,

I’ve spent the last couple of days trying to get NixOS on my OVH dedicated server, bootstrapping it from the OVH rescue mode.

Goal: To get a proper partitions -> RAID -> LUKS -> LVM -> ext4 setup for the data partition, unencrypted / for booting through, but and RAID for everything, including the EFI System Partition (ESP). (I also tried legacy boot, but that only gave me a black screen.)

You can find the script I wrote for it, including detail instructions and explanations, here:

Thanks to clever on IRC who helped me with much of it.

For my own usage, this is only to bootstrap the server to NixOS; afterwards I’ll manage it with nixops.

4 Likes

Perhaps also useful to know: The script takes 3:45 minutes to run on my STOR-1 type server.

I’ve now also made one for Hetzner:

3 Likes

And one for Leaseweb:

1 Like

That’s great! Thanks a lot for tackling this. I failed doing that a few
months ago:

It’s a shame to see this living in a gist though, we probably could
share the maintenaince burden of those scripts. Creating a git
repository hosting these provisionning scripts under the nix community
org would make a lot of sense IMHO.

I also installed NixOS on a Kimsufi server few months ago and here are my notes: https://lewo.abesis.fr/posts/2019-12-01-install-nixos-on-kimsufi.html

I’m up for that. I started with gists because I did it as a one-off for my own usage and just quickly wanted to code dump the thing into the public in case others have the same problems, but by now I’ve done on various servers, investigated some more details, and this could be ready to move under some repo.

Version for Hetzner Cloud:

  1. Buy server (OS picked initially does not matter).
  2. In the Hetzner web UI (see screenshot): Mount the NixOS 20.03 (amd64/minimal) reboot the machine by double-toggling the ON button in the top right.
  3. Edit and run script: https://gist.github.com/nh2/c02612e05d1a0f5dc9fd50dda04b3e48.

1 Like