From 7da979bed20d41b353cf4730de28b0c51bf61a48 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Mallo Date: Wed, 26 Apr 2023 14:09:23 +0200 Subject: [PATCH] Add script to rebuild configuration --- rebuild.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 rebuild.sh diff --git a/rebuild.sh b/rebuild.sh new file mode 100755 index 0000000..592ed38 --- /dev/null +++ b/rebuild.sh @@ -0,0 +1,16 @@ +#!/bin/sh -e + +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