mirror of
https://github.com/nix-community/home-manager.git
synced 2025-12-14 13:01:09 +01:00
git: support maintenance on darwin (#6868)
This commit is contained in:
parent
22b326b42b
commit
42d90297b3
6 changed files with 332 additions and 0 deletions
|
|
@ -753,6 +753,54 @@ in
|
|||
};
|
||||
in
|
||||
lib.attrsets.mapAttrs' toSystemdTimer cfg.maintenance.timers;
|
||||
|
||||
launchd.agents =
|
||||
let
|
||||
baseArguments = [
|
||||
"${lib.getExe cfg.package}"
|
||||
"for-each-repo"
|
||||
"--keep-going"
|
||||
"--config=maintenance.repo"
|
||||
"maintenance"
|
||||
"run"
|
||||
];
|
||||
in
|
||||
{
|
||||
"git-maintenance-hourly" = {
|
||||
enable = true;
|
||||
config = {
|
||||
ProgramArguments = baseArguments ++ [ "--schedule=hourly" ];
|
||||
StartCalendarInterval = map (hour: {
|
||||
Hour = hour;
|
||||
Minute = 53;
|
||||
}) (lib.range 1 23);
|
||||
};
|
||||
};
|
||||
"git-maintenance-daily" = {
|
||||
enable = true;
|
||||
config = {
|
||||
ProgramArguments = baseArguments ++ [ "--schedule=daily" ];
|
||||
StartCalendarInterval = map (weekday: {
|
||||
Weekday = weekday;
|
||||
Hour = 0;
|
||||
Minute = 53;
|
||||
}) (lib.range 1 6);
|
||||
};
|
||||
};
|
||||
"git-maintenance-weekly" = {
|
||||
enable = true;
|
||||
config = {
|
||||
ProgramArguments = baseArguments ++ [ "--schedule=weekly" ];
|
||||
StartCalendarInterval = [
|
||||
{
|
||||
Weekday = 0;
|
||||
Hour = 0;
|
||||
Minute = 53;
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
})
|
||||
|
||||
(mkIf cfg.diff-highlight.enable {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue