mirror of
https://github.com/nix-community/home-manager.git
synced 2026-01-11 01:19:32 +08:00
lib.darwin: simplify assertInterval
This commit is contained in:
committed by
Robert Helgesson
parent
af7f14ddf7
commit
d1da1de5c2
@@ -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."
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user