From 4e9409db10baa26736e69b04e0536a3e2c533cfb Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Mallo Date: Fri, 16 Jun 2023 12:13:07 +0200 Subject: [PATCH] Update rebuild script for all nodes --- rebuild.sh | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/rebuild.sh b/rebuild.sh index 5df9616..1320c24 100755 --- a/rebuild.sh +++ b/rebuild.sh @@ -1,19 +1,16 @@ -#!/bin/sh -e +#!/bin/sh -ex if [ "$(id -u)" != 0 ]; then echo "Needs root permissions" exit 1 fi -host=$(hostname) - -#conf="$(readlink -f .)/${host}/configuration.nix" -# -#if [ ! -e "$conf" ]; then -# echo "Missing config $conf" -# exit 1 -#fi -# -#NIXOS_CONFIG="${conf}" nixos-rebuild switch +if [ "$(hostname)" != "hut" ]; then + >&2 echo "must run from machine hut, not $(hostname)" + exit 1 +fi +# Update all nodes nixos-rebuild switch --flake . +nixos-rebuild switch --flake .#owl1 --target-host owl1 +nixos-rebuild switch --flake .#owl2 --target-host owl2