#!/bin/sh # Wrapper around nixos-rebuild and deploy-rs for the three hosts. # # Usage: # ./deploy.sh # nixos-rebuild boot on current host (mreow/yarn) # ./deploy.sh switch # apply immediately on current host # ./deploy.sh test # apply without adding boot entry # ./deploy.sh build # build only, no activation # ./deploy.sh muffin # build + deploy to muffin via deploy-rs # # muffin cannot be rebuilt locally from another host — this script only issues # the remote deploy via deploy-rs when explicitly named. set -eu host="$(hostname -s)" arg="${1:-boot}" case "$arg" in muffin) exec nix run .#deploy -- .#muffin "$@" ;; boot | switch | test | build) exec nixos-rebuild "$arg" --flake ".#$host" --use-remote-sudo ;; *) echo "usage: $0 [muffin | boot | switch | test | build]" >&2 exit 2 ;; esac