You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Milan b757b8b35c add ascii art
3 months ago
configuration add ascii art 3 months ago
hosts move stateVersion to individual hosts 3 months ago
lib initial commit 3 months ago
modules initial commit 3 months ago
nix initial commit 3 months ago
.gitignore initial commit 3 months ago improve README 3 months ago
default.nix initial commit 3 months ago

rC3 Nixfiles

Notes for handling NixOS systems:

Do not attempt to edit files in /etc unless you know exactly what you are doing. Your changes will be overwritten. All changes must be done in this repository and then deployed as explained below.

Setting up a NixOS on the Hetzner Cloud

Build a kexec tarball. Copy the resulting tarball to the machine and kexec:

nix build -f . kexec_tarball
pv ./result/tarball/nixos-system-x86_64-linux.tar.xz | ssh -o UserKnownHostsFile=/dev/null root@$IP "tar -xJC / && /kexec_nixos"

The machine will reboot into a pre-configured ramdisk with all you need to setup a NixOS installation. Perform the usual NixOS installation procedure.

In short form, it's this:

sudo sgdisk \
    -o \
    -n 1::+1M \
    -n 2::+512M \
    -n 3:: \
    -t 1:ef02 \

sudo mkfs.ext2 /dev/sda2
sudo mkfs.xfs -m reflink=1 /dev/sda3
sudo mount /dev/sda3 /mnt
sudo mkdir /mnt/boot
sudo mount /dev/sda2 /mnt/boot

sudo nixos-generate-config --root /mnt

# At least configure user and ssh for initial deployment
# Also add yourself to `nix.trustedUsers` to allow remote-built (unsigned) packages to be deployed
sudo $EDITOR /mnt/etc/nixos/configuration.nix

sudo nixos-install
sudo reboot

Building and deploying the configuration

nix build -f . deploy.ns1 && ./result switch # deploy ns1 host
nix build -f . deploy.dns && ./result switch # deploy dns group