LnL7 / nix-darwin

nix modules for darwin
MIT License
2.43k stars 407 forks source link

[Revert!] Option `nix.gc.interval.Hour is not of type null or integer between 0 and 23 (both inclusive)'. #977

Closed aspauldingcode closed 2 weeks ago

aspauldingcode commented 2 weeks ago
       error: A definition for option `nix.gc.interval.Hour' is not of type `null or integer between 0 and 23 (both inclusive)'. Definition values:
       - In `/nix/store/ap7k98a0rlmcirr3r2v6iann34hk41dj-source/system/NIXY/darwin-configuration.nix': 24

If I put 23 it works (as 24 hours)

Personally, I disagree with this change. If I ask for 23 hours, it gives nix 24 hours. Meaning, if I say 0 hours for 1, or 11 hours for 12 hours, it makes sense programmatically, but no sense to a person.

nix (Nix) 2.18.2

emilazy commented 2 weeks ago

The behaviour here hasn’t changed, I don’t think; we just tightened up the checking. The syntax and semantics here are from launchd itself; per launchd.plist(5):

Hour <integer>
The hour (0-23) on which this job will be run.

So it’s not the number of hours between runs, it’s the hour of the day that you’d like it to run at. I don’t know what 24 would have been doing previously, but it doesn’t seem like a sensible value to me. Closing as I don’t think there’s an issue here, but feel free to reopen if I’m misunderstanding.

emilazy commented 2 weeks ago

To be honest “interval” is kind of a confusing name here, so maybe the best thing to do here would be to rename those options so that people don’t make the assumption you did about the semantics, but it’s the same term launchd itself uses and I’m not sure what would be better.