From e5a19f916957c42a47da58625ebaa100840531e0 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Fri, 3 Jan 2025 21:01:02 +0400 Subject: [PATCH] whatever this is lmao --- modules/server/fedi/akkoma/default.nix | 34 ++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/modules/server/fedi/akkoma/default.nix b/modules/server/fedi/akkoma/default.nix index 61b1a086..ac2a8657 100644 --- a/modules/server/fedi/akkoma/default.nix +++ b/modules/server/fedi/akkoma/default.nix @@ -146,5 +146,39 @@ in { }; }; }; + # can't have SHIT in detroit + users = { + fedifetcher = { + home = "/var/lib/fedifetcher"; + createHome = true; + isSystemUser = true; + group = "fedifetcher"; + }; + groups.fedifetcher = { }; + }; + + systemd = let + configPath = "/srv/secrets/fedifetcher.json"; + state = "/var/lib/fedifetcher"; + in { + timers.fedifetcher = { + wantedBy = [ "timers.target" ]; + timerConfig = { + OnUnitActiveSec = "1m"; + Unit = "fedifetcher.service"; + }; + }; + services.fedifetcher = { + unitConfig = { ConditionPathExists = configPath; }; + serviceConfig = { + WorkingDirectory = state; + Type = "oneshot"; + ExecStart = "{pkgs.fedifetcher}/bin/fedifetcher" + + " --config ${configPath}" + " --state-dir ${state}"; + user = "fedifetcher"; + group = "fedifetcher"; + }; + }; + }; }; }