HOWTO: Install NixOS on an OVH dedicated server


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.


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:


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: Lewo - How to install NixOS on kimsufi

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: Implementation of nh2's pubkey into (Script to install NixOS from the Hetzner Cloud NixOS bootable ISO image. Wipes the disk!) · GitHub.

1 Like

After running the script on Hetzner Cloud, don’t forget to unmount the ISO and reboot the server again so that it doesn’t boot into the ISO again.

I’m up for doing this now.

Pinging @matthewbauer @zimbatm @grahamc @worldofpeace from People · Nix community projects · GitHub on whether you could add me to nix-community so that I can create a repo for this?

I’m thinking of nixos-install-scripts for the name, any opinions?

nixos-install-scripts sounds good. I can import a repo, so if someone creates it just ping me on freenode (worldofpeace), matrix (worldofpeace), or here :+1:

OK, here’s the repo: GitHub - nix-community/nixos-install-scripts: collection of one-shot scripts to install NixOS on various server hosters and other hardware. [maintainer=@happysalada]


Sounds good! You have been invited.

1 Like

Great thanks, moved it to GitHub - nix-community/nixos-install-scripts: collection of one-shot scripts to install NixOS on various server hosters and other hardware. [maintainer=@happysalada].

I also made a nixos-install-scripts team, but I don’t have permission to add the repo to it under Sign in to GitHub · GitHub. Could an admin do it for me?

Fixed. The project looks great!