fedifetcher: init
This commit is contained in:
parent
6dc160b20a
commit
e60a1a3ff6
3 changed files with 34 additions and 0 deletions
Binary file not shown.
|
@ -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";
|
||||||
|
|
32
system/nixos/fedifetcher.nix
Normal file
32
system/nixos/fedifetcher.nix
Normal 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;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in a new issue