43 lines
1.3 KiB
Nix
43 lines
1.3 KiB
Nix
|
{ pkgs, lib, ... }:
|
||
|
{
|
||
|
# config copied from https://github.com/arachnist/nibylandia/blob/main/nixos/zorigami/default.nix
|
||
|
systemd.services.fedifetcher = {
|
||
|
path = [ pkgs.fedifetcher ];
|
||
|
description = "fetch fedi posts";
|
||
|
script = ''
|
||
|
fedifetcher
|
||
|
'';
|
||
|
environment = lib.mapAttrs' (n: v:
|
||
|
(lib.nameValuePair ("ff_" + builtins.replaceStrings [ "-" ] [ "_" ] n)
|
||
|
(builtins.toString v))) {
|
||
|
server = "social.nekover.se";
|
||
|
state-dir = "/var/lib/fedifetcher";
|
||
|
lock-file = "/run/fedifetcher/fedifetcher.lock";
|
||
|
from-lists = 1;
|
||
|
from-notifications = 1;
|
||
|
max-bookmarks = 80;
|
||
|
max-favourites = 40;
|
||
|
max-follow-requests = 80;
|
||
|
max-followers = 80;
|
||
|
max-followings = 80;
|
||
|
remember-hosts-for-days = 30;
|
||
|
remember-users-for-hours = 168;
|
||
|
reply-interval-in-hours = 2;
|
||
|
};
|
||
|
serviceConfig = {
|
||
|
DynamicUser = true;
|
||
|
User = "fedifetcher";
|
||
|
RuntimeDirectory = "fedifetcher";
|
||
|
RuntimeDirectoryPreserve = true;
|
||
|
StateDirectory = "fedifetcher";
|
||
|
UMask = "0077";
|
||
|
EnvironmentFile = [ "/secrets/mastodon-fedifetcher-access-token.secret" ];
|
||
|
};
|
||
|
};
|
||
|
|
||
|
systemd.timers.fedifetcher = {
|
||
|
wantedBy = [ "multi-user.target" ];
|
||
|
timerConfig = { OnCalendar = "*:0/5"; };
|
||
|
};
|
||
|
}
|