···11#!/usr/bin/env bash
22-# This is a utility wrapper script around nixos-rebuild, intended for use
33-# within the root directory of the repository as a local copy/clone.
22+# This is a utility wrapper script around nixos-rebuild, intended for use within the root directory of the repository
33+# as a local copy/clone. Might implement remote setups soon
44# SPDX-License-Identifier: MPL-2.0
5566set -xe
77HOSTNAME=$(hostname)
88-NIXOS_HOSTNAME=${2:HOSTNAME}
88+NIXOS_HOSTNAME=${2:-"$HOSTNAME"}
99SUDO=${SUDO:"sudo"}
10101111if [[ $EUID != "0" ]]; then
···1818elif [[ $1 == "boot" ]]; then
1919 nixos-rebuild --verbose --show-trace --flake ".#${NIXOS_HOSTNAME}" boot
2020else
2121- echo "Unsupport command"
2121+ echo "Unsupport command for this deployment wrapper"
2222 echo "Usage: $0 <switch|boot> [hostname]"
2323 exit 1
2424fi