From bb08d48579f6a6815836c90e28d6c00301213883 Mon Sep 17 00:00:00 2001 From: Anthony Roussel Date: Sun, 15 Feb 2026 22:35:29 +0100 Subject: [PATCH] nixos/autosuspend: assert at least one check is configured Otherwise autosuspend will fail at startup. --- nixos/modules/services/misc/autosuspend.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/nixos/modules/services/misc/autosuspend.nix b/nixos/modules/services/misc/autosuspend.nix index c5e61ad57bbf..9bbc9b2e7af8 100644 --- a/nixos/modules/services/misc/autosuspend.nix +++ b/nixos/modules/services/misc/autosuspend.nix @@ -226,6 +226,13 @@ in }; config = mkIf cfg.enable { + assertions = [ + { + assertion = cfg.checks != { }; + message = "`services.autosuspend.checks` must contain at least one activity check."; + } + ]; + systemd.services.autosuspend = { description = "A daemon to suspend your server in case of inactivity"; documentation = [ "https://autosuspend.readthedocs.io/en/latest/systemd_integration.html" ];