feat: move rss to it's own module and add atom support

This commit is contained in:
Jet 2026-03-23 15:43:02 -07:00
parent 452b8b49c3
commit 3991d25293
No known key found for this signature in database
11 changed files with 875 additions and 143 deletions

View file

@ -0,0 +1,75 @@
pkg:
{ config, lib, ... }:
let
cfg = config.services.noisebell-rss;
bin = "${pkg}/bin/noisebell-rss";
in
{
options.services.noisebell-rss = {
enable = lib.mkEnableOption "noisebell RSS service";
domain = lib.mkOption {
type = lib.types.str;
description = "Domain for the Caddy virtual host.";
};
port = lib.mkOption {
type = lib.types.port;
default = 3002;
};
cacheUrl = lib.mkOption {
type = lib.types.str;
description = "URL of the cache service (e.g. http://localhost:3000).";
};
httpTimeoutSecs = lib.mkOption {
type = lib.types.ints.positive;
default = 10;
};
};
config = lib.mkIf cfg.enable {
users.users.noisebell-rss = {
isSystemUser = true;
group = "noisebell-rss";
};
users.groups.noisebell-rss = { };
services.caddy.virtualHosts.${cfg.domain}.extraConfig = ''
reverse_proxy localhost:${toString cfg.port}
'';
systemd.services.noisebell-rss = {
description = "Noisebell RSS service";
wantedBy = [ "multi-user.target" ];
after = [ "network-online.target" ];
wants = [ "network-online.target" ];
environment = {
NOISEBELL_RSS_PORT = toString cfg.port;
NOISEBELL_RSS_CACHE_URL = cfg.cacheUrl;
NOISEBELL_RSS_HTTP_TIMEOUT_SECS = toString cfg.httpTimeoutSecs;
RUST_LOG = "info";
};
script = ''
exec ${bin}
'';
serviceConfig = {
Type = "simple";
Restart = "on-failure";
RestartSec = 5;
User = "noisebell-rss";
Group = "noisebell-rss";
NoNewPrivileges = true;
ProtectSystem = "strict";
ProtectHome = true;
PrivateTmp = true;
ProtectKernelTunables = true;
ProtectKernelModules = true;
ProtectControlGroups = true;
RestrictSUIDSGID = true;
};
};
};
}