Automate update of java flake
This commit is contained in:
parent
470a48a1ea
commit
ffee83c7c5
|
@ -21,53 +21,42 @@ let
|
||||||
nix
|
nix
|
||||||
nix-prefetch
|
nix-prefetch
|
||||||
];
|
];
|
||||||
in {
|
update-flake = { name, repo, schedule, branch ? "trunk" }: {
|
||||||
# Setup hosts for gitea automation
|
systemd.services."update-flake-${name}" = {
|
||||||
|
inherit environment;
|
||||||
|
inherit path;
|
||||||
|
script = ''
|
||||||
|
env
|
||||||
|
${repo-updater}/bin/repo-updater ${repo} ${branch}
|
||||||
|
'';
|
||||||
|
serviceConfig = {
|
||||||
|
Type = "oneshot";
|
||||||
|
User = "nathan";
|
||||||
|
Group = "users";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
systemd.timers."update-flake-${name}" = {
|
||||||
|
wantedBy = [ "timers.target" ];
|
||||||
|
partOf = [ "update-flake-${name}.service" ];
|
||||||
|
timerConfig = {
|
||||||
|
OnCalendar = schedule;
|
||||||
|
Unit = "update-flake-${name}.service";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
in { # Setup hosts for gitea automation
|
||||||
networking.hosts = { "100.99.69.14" = [ "git.stranger.systems" ]; };
|
networking.hosts = { "100.99.69.14" = [ "git.stranger.systems" ]; };
|
||||||
|
} // update-flake {
|
||||||
# Automate updating the system flake
|
name = "system";
|
||||||
systemd.services."system-flake-update" = {
|
repo = "gitea@git.stranger.systems:nix/System.git";
|
||||||
inherit environment;
|
schedule = "Mon, 4:00";
|
||||||
inherit path;
|
} // update-flake {
|
||||||
script = ''
|
name = "rust-util";
|
||||||
env
|
repo = "gitea@git.stranger.systems:nix/Rust.git";
|
||||||
${repo-updater}/bin/repo-updater gitea@git.stranger.systems:nix/System.git trunk
|
schedule = "Mon, 8:00";
|
||||||
'';
|
} // update-flake {
|
||||||
serviceConfig = {
|
name = "java";
|
||||||
Type = "oneshot";
|
repo = "gitea@git.stranger.systems:nix/java.git";
|
||||||
User = "nathan";
|
schedule = "6:00";
|
||||||
Group = "users";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
systemd.timers."system-flake-update" = {
|
|
||||||
wantedBy = [ "timers.target" ];
|
|
||||||
partOf = [ "system-flake-update.service" ];
|
|
||||||
timerConfig = {
|
|
||||||
OnCalendar = "Mon, 4:00";
|
|
||||||
Unit = "system-flake-update.service";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
# Automate updating rust utility flake
|
|
||||||
systemd.services."rust-util-update" = {
|
|
||||||
inherit environment;
|
|
||||||
inherit path;
|
|
||||||
script = ''
|
|
||||||
env
|
|
||||||
${repo-updater}/bin/repo-updater gitea@git.stranger.systems:nix/Rust.git trunk
|
|
||||||
'';
|
|
||||||
serviceConfig = {
|
|
||||||
Type = "oneshot";
|
|
||||||
User = "nathan";
|
|
||||||
Group = "users";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
systemd.timers."rust-util-update" = {
|
|
||||||
wantedBy = [ "timers.target" ];
|
|
||||||
partOf = [ "rust-util-update.service" ];
|
|
||||||
timerConfig = {
|
|
||||||
OnCalendar = "Mon, 8:00";
|
|
||||||
Unit = "rust-util-update.service";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue