Provisioning a NixOS Server

Provisioning a NixOS server from macOS post

Nix is a purely functional package manager and NixOS is a purely functional Linux distribution. I have been running a NixOS server for a while now, and been quite happy with the configuration. However updating it has essentially been copying the configuration.nix file over and calling nixos-rebuild switch --upgrade. This builds packages that are not in the cache on the server. NixOps is the NixOS cloud deployment tool and I should be able to use it to provision the server. Specifically using NixOps on macOS seems to be rather uncommon. I’ll detail my process, so that we all may benefit from using NixOps on macOS to provision a NixOS linux server.

Docker Desktop site

$ brew install homebrew/cask/docker

$ docker run --rm -it lnl7/nix

bash-4.4# nix repl '<nixpkgs>'

✗ docker run --rm -it lnl7/nix nix repl '<nixpkgs>'

nix-repl> system "x86_64-linux"

Next: To turn that into a – could we please find a better word than – "build slave"