I’m an Arch user (CachyOS now) and I’ve gotten used to doing things a certain way. Anyway, I have another computer with a fresh Windows 11 install. After literally 5 hours of troubleshooting, I still could not get the fuckass wi-fi drivers installed. People who say Windows is easy clearly never had to install it. I eventually said fuck it and decided to install NixOS. I’m used to Arch based distros so I wanted to try something new. I’m very confused about how it works and what it’s intended use case is. I spent an hour trying to figure out how to install micro permanently. I did RTFM but It didn’t really help. I guess I’m hoping someone can share some words of encouragement and/or convince and/or bully me into sticking with this weird ass distro.
Maybe one day corporate stuff. You just need to write one file to copy-paste and identical system to dozens of your employees’ issued devices
I’ve been using NixOS for years now (the 1st commit is from 2020). The benefits I particularly enjoy:
- mostly-atomic updates and rollbacks
- versioned configuration, with history in Git
- uniformity of configuration across machines - my allowed SSH pubkeys are in NixOS config, so I only have one source-of-truth to update if I want to add or revoke one (and then rebuild every machine, of course (maybe I should invent an automated provisioning/deploy system)).
- (advanced, but not complex) composable configuration - NixOS has modules.
- I enable my user and Wireguard in every machine, along with the Prometheus host exporter
- I enable more Prometheus exporters in servers - nginx, and whatnot.
- (advanced, complex) programmable config
- (advanced) overlays - easily change your OS
If a software update goes south, just reboot into the last known good one, until you have time to figure out what broke. This only applies to OS config, it doesn’t apply to data, so if you need to migrate your Postgres to a new on-disk format, or such, you still need a snapshot or backup of some sort.
It’s very easy to keep config in Git - I’m aware of
etckeeper, but NixOS treats your Git repo as the primary source of truth, not a tacked-on addition.It’s possible to write parametric configurations, to loop over machines, etc. For example, here’s how I import the module that enables and unfirewalls Prometheus exporters, in one particular machine:
(import ../modules/wireguard-prometheus-exporters.nix { exporters = [ "knot" "nginx" "nginxlog" "node" "postgres" "redis" "systemd" "wireguard" ]; })Other machines don’t have
knotorredis, so I just omit them from the list.
Here’s a simplified snippet of the implementation:{ exporters, }: # this is a lambda taking a parameter, the list of Prometheus exporters per host { config, lib, ... }: { services.prometheus.exporters = lib.genAttrs exporters ( exporter: { enable = true; } # ... etc. There's more stuff here, but this is the gist. }This thing above produces approximately this NixOS config:
services.prometheus.exporters.knot = { enable = true; }; services.prometheus.exporters.nginx = { enable = true; }; services.prometheus.exporters.nginxlog = { enable = true; }; # ... etcEdit: I forgot about overlays. You can patch software, or switch to forks, much more easily with NixOS. For example, here I’m applying some mods to my laptop:
nixpkgs.overlays = [ (import ../overlays/wlvncc-overlay.nix) # add clipboard support ];and here’s its definition - nothing could be simpler.
final: prev: { wlvncc = prev.wlvncc.overrideAttrs (old: { patches = (old.patches or [ ]) ++ [ ./wlvncc-clipboard-sync.patch ]; }); }The patch itself is generated by
git diffin the source of wlvncc. Alternatively, I could have switched to a fork, here’s how: https://wiki.nixos.org/wiki/Overlays#Overriding_a_version



