feat: removed nr script since it is no longer necessary with nh

This commit is contained in:
Ceferino Patino 2026-05-04 15:20:45 -05:00
commit e66a91bd5a
Signed by: c4patino
SSH key fingerprint: SHA256:Wu+cU1t+7zVT9wzew/4meNmeulo66NzMqc22MdDBgXI
2 changed files with 0 additions and 53 deletions

View file

@ -19,7 +19,6 @@ in {
(import ./clock.nix {inherit pkgs;})
(import ./format-drive.nix {inherit pkgs;})
(import ./get-music-cover.nix {inherit pkgs;})
(import ./nr.nix {inherit pkgs;})
(import ./scratchpad.nix {inherit pkgs;})
];
};

View file

@ -1,52 +0,0 @@
{pkgs, ...}:
pkgs.writeShellScriptBin "nr" ''
set -euo pipefail
usage() {
cat <<EOF
Usage:
nr switch <hostname> Rebuild and switch configuration on <hostname> using nixos-rebuild.
nr --help Show this help message.
EOF
}
if [[ "$#" -lt 1 ]]; then
echo "Error: Missing subcommand."
usage
exit 1
fi
if [[ "$1" == "--help" || "$1" == "-h" ]]; then
usage
exit 0
fi
if [ "$#" -lt 2 ]; then
echo "Usage: nr <subcommand> <hostname>"
exit 1
fi
SUBCOMMAND="$1"
HOSTNAME="$2"
case "$SUBCOMMAND" in
switch)
if [[ -z "$HOSTNAME" ]]; then
echo "Error: Missing hostname for 'switch' subcommand."
usage
exit 1
fi
echo "Running nixos-rebuild switch for host: $HOSTNAME"
sudo nixos-rebuild switch \
--flake ~/dotfiles#"$HOSTNAME" \
--target-host "c4patino@$HOSTNAME" \
--use-remote-sudo
;;
*)
echo "Error: Unknown subcommand '$SUBCOMMAND'"
usage
exit 1
;;
esac
''