• 0 Posts
  • 5 Comments
Joined 2 years ago
cake
Cake day: June 20th, 2023

help-circle
  • On the topic of build times, it took me too long to learn that nixos-rebuild supports remote build workers and targets.

    For example, if I am editing on my laptop, want to build on my desktop, and apply the build to my file server, then I’d run…

    me@laptop$ nixos-rebuild test \
    --flake ~/wherever-it-lives \
    --build-host desktop \
    --target-host file-server \
    --use-remote-sudo
    

    The host names should match the name of the nixosConfiguration output from your flake. If they don’t I think you can specify like, --target-host .#some-machine

    Remote sudo avoids having to SSH as root.

    Bonus tip: Having Tailscale on every machine makes this work reliably from anywhere, network speed as the limit.