feat(scripts): add rebuild scripts, check sops script
This commit is contained in:
parent
25be2b18a0
commit
8cee6c464c
|
@ -0,0 +1,16 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
# FIXME: Make this better
|
||||||
|
sops_result=$(journalctl --no-pager --no-hostname --since "10 minutes ago" |
|
||||||
|
tac |
|
||||||
|
awk '!flag; /Starting sops-nix activation/{flag = 1};' |
|
||||||
|
tac |
|
||||||
|
grep sops)
|
||||||
|
|
||||||
|
# If we don't have "Finished sops-nix activation." in the logs, then we failed
|
||||||
|
if [[ ! $sops_result =~ "Finished sops-nix activation" ]]; then
|
||||||
|
echo "sops-nix failed to activate"
|
||||||
|
echo "$sops_result"
|
||||||
|
exit 1
|
||||||
|
fi
|
|
@ -0,0 +1,9 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
if [ ! -z $1 ]; then
|
||||||
|
export HOST=$1
|
||||||
|
else
|
||||||
|
export HOST=$(hostname)
|
||||||
|
fi
|
||||||
|
|
||||||
|
sudo nixos-rebuild --show-trace --impure --flake .#$HOST switch
|
|
@ -0,0 +1,9 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
if [ ! -z $1 ]; then
|
||||||
|
export HOST=$1
|
||||||
|
else
|
||||||
|
export HOST=$(hostname)
|
||||||
|
fi
|
||||||
|
|
||||||
|
sudo nixos-rebuild --impure --flake .#$HOST switch
|
|
@ -0,0 +1,9 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
if [ ! -z $1 ]; then
|
||||||
|
export HOST=$1
|
||||||
|
else
|
||||||
|
export HOST=$(hostname)
|
||||||
|
fi
|
||||||
|
|
||||||
|
sudo nixos-rebuild --impure --flake .#$HOST test
|
Loading…
Reference in New Issue