Run NixOS in a DigitalOcean Droplet
Table of Contents
This little tutorial will show you how to turn an Ubuntu Droplet (VM) on DigitalOcean into a NixOS Droplet using nixos-infect. NixOS is a Linux distribution declaratively configured using a specification written in the Nix expression language describing the system’s desired state. It supports automatic upgrades and rollbacks.
Aside from DigitalOcean, you can run NixOS on most common computers . It’s possible to run NixOS on ARM64 computers, like on the Raspberry Pi 3 and Raspberry Pi 4 .
This tutorial will transform Ubuntu 18.04 LTS into NixOS 19.09 Loris.
Prepare #
Create a Droplet on DigitalOcean. I’d recommend a minimum of 2GB RAM, running Ubuntu 18.04 LTS.
Transform into NixOS #
First, clone the nixos-infect
repository:
$ git clone https://github.com/elitak/nixos-infect.git
Then simply run nixos-infect
:
cd nixos-infect/
./nixos-infect
Give it some time, and you’ll eventually have a NixOS installation on your Droplet. Please note that this is highly experimental and not for any production use.
You can provide loads of configuration options to nixos-infect
and NixOS itself. Please refer to the nixos-infect
documentation and the NixOS
documentation.
Good luck! 😀
Revision #
2023-08-31 Revised language