1
0
Fork 0
dotfiles/system/nixos/fedifetcher.nix

39 lines
910 B
Nix
Raw Normal View History

{ config, ... }:
2023-05-29 00:01:24 +00:00
2023-07-03 08:26:35 +00:00
let
podman = config.virtualisation.podman.package;
image = "ghcr.io/nanos/fedifetcher:latest";
in
2023-05-29 00:01:24 +00:00
{
systemd.tmpfiles.rules = [
"d /var/lib/fedifetcher 0744 root root"
];
2023-05-29 00:01:24 +00:00
systemd.services.fedifetcher = {
2023-05-31 08:46:40 +00:00
description = "FediFetcher";
2023-06-04 14:41:03 +00:00
wants = [ "mastodon-web.service" ];
after = [ "mastodon-web.service" ];
2023-06-22 18:57:21 +00:00
# wantedBy = [ "multi-user.target" ];
2023-05-31 08:46:40 +00:00
startAt = "*:0/25";
2023-05-29 00:01:24 +00:00
serviceConfig =
let
data = "/var/lib/fedifetcher:/app/artifacts";
in
{
Type = "oneshot";
ExecStart = "${podman}/bin/podman run --name fedifetcher -v ${data} --rm ${image} --config=/app/artifacts/config.json";
2023-05-29 00:01:24 +00:00
};
};
2023-07-03 08:26:35 +00:00
systemd.services.fedifetcher-updater = {
description = "FediFetcher Updater";
startAt = "daily";
serviceConfig = {
Type = "oneshot";
ExecStart = "${podman}/bin/podman pull ${image}";
};
};
2023-05-29 00:01:24 +00:00
}