1
0
Fork 0

fedifetcher: init

This commit is contained in:
Daniel Kempkens 2023-05-29 02:01:24 +02:00
parent 6dc160b20a
commit e60a1a3ff6
Signed by: daniel
SSH key fingerprint: SHA256:Ks/MyhQYcPRQiwMKLAKquWCdCPe3JXlb1WttgnAoSeM
3 changed files with 34 additions and 0 deletions

Binary file not shown.

View file

@ -48,6 +48,8 @@ in
../../container/weewx ../../container/weewx
../../container/matrix ../../container/matrix
../../container/proxitok ../../container/proxitok
(import ../nixos/fedifetcher.nix (args // { inherit secret; }))
]; ];
system.stateVersion = "22.11"; system.stateVersion = "22.11";

View file

@ -0,0 +1,32 @@
{ config, secret, ... }:
{
systemd.services.fedifetcher = {
wants = [ "mastodon-web.service" "mastodon-sidekiq.service" ];
after = [ "mastodon-web.service" "mastodon-sidekiq.service" ];
wantedBy = [ "default.target" ];
serviceConfig =
let
podman = config.virtualisation.podman.package;
image = "ghcr.io/nanos/fedifetcher:latest";
data = "/var/lib/fedifetcher:/app/artifacts";
token = secret.mastodon.fedifetcher.accessToken;
server = "mastodon.kempkens.io";
in
{
Type = "oneshot";
ExecStart = "${podman}/bin/podman run -v ${data} --rm ${image} --access-token=${token} --server=${server} --home-timeline-length=50 --max-followings=5 --from-notifications=1";
};
};
systemd.timers.fedifetcher = {
wantedBy = [ "timers.target" ];
timerConfig = {
OnUnitInactiveSec = "15minutes";
RandomizedDelaySec = 30;
Persistent = true;
};
};
}