mirror of
https://github.com/nix-community/home-manager.git
synced 2025-11-08 19:46:05 +01:00
Previously, if an invalid value was passed, the build would fail with:
error: attribute '"00:02:03"' missing
at /nix/store/sz92b5gqi0ma61d18fwbihi8p37mkvir-source/modules/services/nix-gc.nix:69:5:
68| in
69| freq.${frequency};
| ^
70|
There was an assertion that should have prevented this from happening
but the crash would happen before the assertion gets a chance to stop
the build with a nice error message.
This commit both gives the assertion a chance to trigger and improves
the assertion's error message.
10 lines
222 B
Nix
10 lines
222 B
Nix
{
|
|
nix.gc = {
|
|
automatic = true;
|
|
frequency = "00:02:03";
|
|
};
|
|
|
|
test.asserts.assertions.expected = [
|
|
"On Darwin nix.gc.frequency must be one of: hourly, daily, weekly, monthly, semiannually, annually."
|
|
];
|
|
}
|