Unverified Commit bb08d485 authored by Anthony Roussel's avatar Anthony Roussel
Browse files

nixos/autosuspend: assert at least one check is configured

Otherwise autosuspend will fail at startup.
parent 7521b277
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -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" ];