Add script to rebuild configuration

This commit is contained in:
Rodrigo Arias 2023-04-26 14:09:23 +02:00
parent cfe37640ea
commit 7da979bed2

16
rebuild.sh Executable file
View File

@ -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