1
0
nixfiles/hosts/web-2/feeds.nix

49 lines
996 B
Nix

{ pkgs, ... }:
{
users.users."feeds" = {
isSystemUser = true;
group = "feeds";
};
users.groups."feeds" = {};
systemd.tmpfiles.rules = [
"d /var/lib/feeds - feeds feeds - -"
];
services.nginx = {
virtualHosts."feeds.clerie.de" = {
enableACME = true;
forceSSL = true;
root = "/var/lib/feeds";
};
};
systemd.services."feeds" = {
wantedBy = [ "multi-user.target" ];
requires = [ "network.target" ];
after = [ "network.target" ];
serviceConfig = {
Type = "oneshot";
WorkingDirectory = "/var/lib/feeds";
RuntimeDirectory = "feeds";
User = "feeds";
Group = "feeds";
ExecStart = ''
${pkgs.feeds-dir}/bin/feeds-dir
'';
};
};
systemd.timers."feeds" = {
wantedBy = [ "timers.target" ];
timerConfig = {
OnCalendar = "hourly";
RandomizedDelaySec = "1h";
};
requires = [ "network-online.target" ];
after = [ "network-online.target" ];
};
}