mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-07-06 17:13:24 -05:00
nixos/autosuspend: assert at least one check is configured
Otherwise autosuspend will fail at startup.
This commit is contained in:
parent
7521b2779b
commit
bb08d48579
1 changed files with 7 additions and 0 deletions
|
|
@ -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" ];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue