nixos/autosuspend: assert at least one check is configured

Otherwise autosuspend will fail at startup.
This commit is contained in:
Anthony Roussel 2026-02-15 22:35:29 +01:00
commit bb08d48579
No known key found for this signature in database
GPG key ID: 2E44EB570B6688B3

View file

@ -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" ];