Setup a new machine using GNU Stow, Nix (nix-darwin on mac), and scripting.
We want to have an entirely reproducible system across whatever underlying OS, so Nix and stow create a method for performing this setup
sh <(curl -L https://nixos.org/nix/install) --daemonWe will create setup scripts for the OS’s we use (unix based)
Run nixos-config.sh:
I have this aliased in my .zshrc to nrs for “nix rebuild switch”
#!/bin/bash
# Save as ~/Dotfiles/scripts/nixos-config.sh
# Copy configs to system location
sudo cp -r ~/Dotfiles/nixos/* /etc/nixos/
# Optionally rebuild
read -p "Rebuild NixOS now? (y/n): " answer
if [[ $answer == "y" ]]; then
sudo nixos-rebuild switch
fi