chore: Finish up install scripts.
This commit is contained in:
parent
3c291b8a95
commit
72b9dd88e5
8 changed files with 72 additions and 14 deletions
16
nixinfra/update.sh
Normal file
16
nixinfra/update.sh
Normal file
|
@ -0,0 +1,16 @@
|
|||
#!/usr/bin/env bash
|
||||
if [[ "$NIX_BUILD_ID" == "" ]]; then
|
||||
echo "ERROR: You have held a (potentially) broken install!"
|
||||
echo "NIX_BUILD_ID is not set (should be set by default!)"
|
||||
echo "Please set NIX_BUILD_ID manually. i.e:"
|
||||
echo "NIX_BUILD_ID=kitteh-node-1/agent updater"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ "$UID" != "0" ]]; then
|
||||
sudo $0 $@
|
||||
exit $?
|
||||
fi
|
||||
|
||||
export NIX_PATH="$(printf $NIX_PATH | sed --expression="s#/etc/nixos/configuration.nix#/etc/nixos/nixinfra/$NIX_BUILD_ID.nix#g")"
|
||||
nixos-rebuild switch --upgrade
|
Reference in a new issue