home/git: use upstream git-maintenance units
This commit is contained in:
@@ -14,10 +14,6 @@ let
|
|||||||
];
|
];
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
imports = [
|
|
||||||
./maintenance-timers.nix
|
|
||||||
];
|
|
||||||
|
|
||||||
# TODO: convert to template once nix-sops supports it in hm module
|
# TODO: convert to template once nix-sops supports it in hm module
|
||||||
sops.secrets."git/nordicsemi-config" = { };
|
sops.secrets."git/nordicsemi-config" = { };
|
||||||
|
|
||||||
@@ -35,6 +31,8 @@ in
|
|||||||
signByDefault = true;
|
signByDefault = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
maintenance.enable = true;
|
||||||
|
|
||||||
lfs.enable = true;
|
lfs.enable = true;
|
||||||
|
|
||||||
delta = {
|
delta = {
|
||||||
|
@@ -1,56 +0,0 @@
|
|||||||
{ config, pkgs, lib, ... }:
|
|
||||||
let
|
|
||||||
cfg = config.programs.git;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
systemd.user.services."git-maintenance@" = {
|
|
||||||
Unit = {
|
|
||||||
Description = "Optimize Git repositories data";
|
|
||||||
Documentation = [ "man:git-maintenance(1)" ];
|
|
||||||
};
|
|
||||||
|
|
||||||
Service = {
|
|
||||||
Type = "oneshot";
|
|
||||||
ExecStart = "${lib.getExe pkgs.git} for-each-repo --config=maintenance.repo maintenance run --no-quiet --schedule=%i";
|
|
||||||
|
|
||||||
Environment = [
|
|
||||||
"PATH=${lib.makeBinPath (with pkgs; [ cfg.package openssh ])}"
|
|
||||||
];
|
|
||||||
|
|
||||||
LockPersonality = "yes";
|
|
||||||
MemoryDenyWriteExecute = "yes";
|
|
||||||
NoNewPrivileges = "yes";
|
|
||||||
RestrictAddressFamilies = [
|
|
||||||
"AF_UNIX"
|
|
||||||
"AF_INET"
|
|
||||||
"AF_INET6"
|
|
||||||
"AF_VSOCK"
|
|
||||||
];
|
|
||||||
RestrictNamespaces = "yes";
|
|
||||||
RestrictRealtime = "yes";
|
|
||||||
RestrictSUIDSGID = "yes";
|
|
||||||
SystemCallArchitectures = "native";
|
|
||||||
SystemCallFilter = "@system-service";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
systemd.user.timers."git-maintenance@" = {
|
|
||||||
Unit = {
|
|
||||||
Description = "Optimize Git repositories data";
|
|
||||||
Documentation = [ "man:git-maintenance(1)" ];
|
|
||||||
};
|
|
||||||
|
|
||||||
Timer = {
|
|
||||||
Persistent = true;
|
|
||||||
OnCalendar = "%i";
|
|
||||||
};
|
|
||||||
|
|
||||||
Install = {
|
|
||||||
WantedBy = [ "timers.target" ];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
systemd.user.timers."git-maintenance@hourly".Timer.OnCalendar = "*-*-* 1..23:05:00";
|
|
||||||
systemd.user.timers."git-maintenance@daily".Timer.OnCalendar = "Tue..Sun *-*-* 0:05:00";
|
|
||||||
systemd.user.timers."git-maintenance@weekly".Timer.OnCalendar = "Mon 0:05:00";
|
|
||||||
}
|
|
Reference in New Issue
Block a user