hosts: use system profile to detect kernel updates

This commit is contained in:
Max Headroom 2023-12-05 01:13:15 +01:00
parent 4bec53ce01
commit 98903689b5

View file

@ -47,7 +47,7 @@ in
'';
in pkgs.writeShellScript "post-effect.sh" ''
export PATH="${pkgs.consul}/bin:${pkgs.coreutils}/bin"
if [[ "$(realpath /run/booted-system/kernel)" != "$(realpath /run/current-system/kernel)" ]]; then
if [[ "$(realpath /run/booted-system/kernel)" != "$(realpath /nix/var/nix/profiles/system/kernel)" ]]; then
echo "Scheduling reboot for kernel upgrade"
if ! consul members >/dev/null; then
echo "Consul not active, skipping reboot"