synix/modules/nixos/rss-bridge/default.nix
sid ecf5132cbb
Some checks failed
Build tests / build-hosts (pull_request) Failing after 3s
Flake check / flake-check (pull_request) Failing after 13s
enforce new flake schema. formatting.
2026-05-31 18:50:41 +02:00

40 lines
996 B
Nix

{ config, lib, ... }:
let
cfg = config.services.rss-bridge;
inherit (config.networking) domain;
inherit (cfg.reverseProxy) subdomain;
fqdn = if (cfg.reverseProxy.enable && subdomain != "") then "${subdomain}.${domain}" else domain;
inherit (lib)
mkIf
;
inherit (lib.utils)
mkReverseProxyOption
;
in
{
options.services.rss-bridge = {
reverseProxy = mkReverseProxyOption "RSS-Bridge" "rss-bridge";
};
config = mkIf cfg.enable {
services.rss-bridge = {
webserver = if cfg.reverseProxy.enable then "nginx" else null;
virtualHost = if cfg.reverseProxy.enable then fqdn else null;
config = {
system.enabled_bridges = [ "*" ];
};
};
systemd.tmpfiles.rules = [ "d ${cfg.dataDir} 0755 ${cfg.user} ${cfg.group} -" ];
services.nginx.virtualHosts = mkIf cfg.reverseProxy.enable {
"${fqdn}" = {
enableACME = cfg.reverseProxy.forceSSL;
inherit (cfg.reverseProxy) forceSSL;
};
};
};
}