An all-in-one script for installing NixOS on top of any existing Linux system without using live media. When you reboot, you're in NixOS.
nixos-in-place is known to work on Ubuntu, Debian, CentOS, Fedora, Arch, and Slackware, including x86 and x86_64 variants, with and without LVM, including systems on Digital Ocean droplets and Hetzner Cloud!
-
BACKUP
-
See the Platform-specifics for your distribution
-
Run the following (see
./install -h
for options)$ ./install
-
STOP AND VERIFY, then hit
y
to confirm -
Grab some coffee while NixOS installs
-
Hit
y
to reboot into NixOS! (root's password will be 'nixos') -
Go through the first section of
/etc/nixos/nixos-in-place.nix
and remove or change it as you see fit
A fresh install of NixOS, either minimal or graphical (your choice). Your
old system and all your old files still exist and are setup to mount on
/old-root
. As far as the file system is concerned, NixOS is installed in
/old-root/nixos
and /
is rebound before spinning up the system; everything
else in /old-root
is fair game to delete.
NixOS installs GRUB2 on top of your existing boot loader. If you'd like to boot
into /old-root
, you can; you just need to add the GRUB entry, from
/old-root/boot/grub
, manually in your Nix files.
DO makes some assumptions about static ips and networking, based on the droplet OS and version you choose. nixos-in-place will work best from a Debian 8 droplet.
To install on a DO droplet, follow the normal steps for your platform, but add
the -d
flag to ./install
(see -h
for more info). Once installed, if you
clean up /old-root
, you must keep /old-root/etc/network
around; DO needs it!
The default configuration for NixOS disables SSH, so you'll need to use the DO console, once you've finished the installation, in order to setup which services you'd actually like.
I recommend installing from a tmux session, to avoid SSH timeouts and losing access to your install part-way through. Seriously, use tmux or screen.