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.

6 Likes

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

1 Like

I’ve now also made one for Hetzner:

4 Likes

And one for Leaseweb:

2 Likes

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.

1 Like

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

1 Like

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.

1 Like

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 https://github.com/nix-community/nixos-install-scripts/blob/master/hosters/hetzner-cloud/nixos-install-hetzner-cloud.sh (Script to install NixOS from the Hetzner Cloud NixOS bootable ISO image. Wipes the disk!) · GitHub.

2 Likes

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.

1 Like

I’m up for doing this now.

Pinging @matthewbauer @zimbatm @grahamc @worldofpeace from Members · People · nix-community · 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?

1 Like

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:

1 Like

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]

3 Likes

Sounds good! You have been invited.

2 Likes

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?

1 Like

Fixed. The project looks great!

1 Like

Hey everyone. I talked to someone at OVH who told me that we should upvote this issue maybe to have more chances to get nixos flavoured VPS’s.

1 Like