#!/usr/bin/env bash host_file="$1" if [ -z "$host_file" ]; then echo "usage: ./rebuild.sh " exit 1 fi host=$(head -n 1 $host_file) if [ -z "$host" ]; then echo "could not find host from '$host_file'" exit 1 fi echo "rebuilding '$host' and making it the boot default" sudo nixos-rebuild boot --flake .#$host