lib.darwin: simplify assertInterval
This commit is contained in:
parent
af7f14ddf7
commit
d1da1de5c2
4 changed files with 6 additions and 6 deletions
|
|
@ -63,12 +63,12 @@ let
|
|||
intervalsString = lib.concatStringsSep ", " intervals;
|
||||
|
||||
assertInterval = option: interval: pkgs: {
|
||||
assertion = (!pkgs.stdenv.isDarwin) || (lib.elem interval intervals);
|
||||
message = "On Darwin ${option} must be one of: ${intervalsString}.";
|
||||
assertion = pkgs.stdenv.isDarwin -> lib.elem interval intervals;
|
||||
message = "On Darwin, ${option} must be one of: ${intervalsString}.";
|
||||
};
|
||||
|
||||
intervalDocumentation = ''
|
||||
On Darwin it must be one of: ${intervalsString}, which are implemented as defined in {manpage}`systemd.time(7)`.
|
||||
On Darwin, it must be one of: ${intervalsString}, which are implemented as defined in {manpage}`systemd.time(7)`.
|
||||
'';
|
||||
in
|
||||
{
|
||||
|
|
|
|||
|
|
@ -5,6 +5,6 @@
|
|||
};
|
||||
|
||||
test.asserts.assertions.expected = [
|
||||
"On Darwin services.borgmatic.frequency must be one of: hourly, daily, weekly, monthly, semiannually, annually."
|
||||
"On Darwin, services.borgmatic.frequency must be one of: hourly, daily, weekly, monthly, semiannually, annually."
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,6 @@
|
|||
};
|
||||
|
||||
test.asserts.assertions.expected = [
|
||||
"On Darwin services.home-manager.autoExpire.frequency must be one of: hourly, daily, weekly, monthly, semiannually, annually."
|
||||
"On Darwin, services.home-manager.autoExpire.frequency must be one of: hourly, daily, weekly, monthly, semiannually, annually."
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,6 @@
|
|||
};
|
||||
|
||||
test.asserts.assertions.expected = [
|
||||
"On Darwin nix.gc.dates.* must be one of: hourly, daily, weekly, monthly, semiannually, annually."
|
||||
"On Darwin, nix.gc.dates.* must be one of: hourly, daily, weekly, monthly, semiannually, annually."
|
||||
];
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue