diff --git a/hosts/yodaHedgehog/host-specific.nix b/hosts/yodaHedgehog/host-specific.nix index a86e085..7f6e889 100644 --- a/hosts/yodaHedgehog/host-specific.nix +++ b/hosts/yodaHedgehog/host-specific.nix @@ -127,6 +127,16 @@ in sleep 60s done + # Wait until no nix garbage collection service is running. + while :; do + running_services="$(systemctl list-units --type=service --plain --quiet | awk '{ print $1 }')" + if ! printf '%s' "''${running_services}" | grep '^nix-gc.service$'; then + break; + fi + printf '%s\n' 'Delaying suspend due to running nix garbage collection service.' + sleep 60s + done + # Send filtered journal by email. systemctl start journalwatch.service ||: # Send notification by email.