NixOs

NixOs is a Linux distro based on a fully declarative package manager, Nix. Forget about keeping a script for setting up your system or storing your dotfiles in a repository, Nix will take care of it.

I am currently using NixOs on my server/homelab infrastructure. From my experience so far, it is a step up from Ansible playbooks or similar tools. I am reluctant to switch my main laptops to NixOs, as it's not as easy to program on NixOs as it is to deploy software on it. Hopefully this will change in the future :)

Useful links:

Tips & notes

Switching configurations with confidence

My homelab consists of a VPS with a static IP and a server at my place. If I mess something up with the networking configuration (which happened more than I initially thought), I might break the VPN configuration to my homeserver. This would be far from perfect when I'm away from home as I'm unable to log in locally and fix the networking configuration.

I didn't want to install something like Tailscale or ZeroTier because I'm a purist because it's my homelab and I wanted to be independent!

The deployment procedure has been working for me for over 2 years and survived multiple configuration mishaps:

  1. Run nixos-rebuild build before you make any modifications
  2. Schedule a reboot in 15 minutes
  3. Run nixos-rebuild test
  4. Run VPN connectivity tests (simple pings via some script or via ansible)
  5. Cancel the scheduled reboot
  6. Run nixos-rebuild switch