diff options
Diffstat (limited to 'modules/services/rss.nix')
-rw-r--r-- | modules/services/rss.nix | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/modules/services/rss.nix b/modules/services/rss.nix new file mode 100644 index 0000000..7c44580 --- /dev/null +++ b/modules/services/rss.nix @@ -0,0 +1,39 @@ +{ config, lib, pkgs, ... }: + +with lib; +let + cfg = config.modules.services.rss; +in +{ + options.modules.services.rss = { + enable = mkEnableOption "RSS Aggregator"; + domain = mkOption { type = types.str; }; + realHost = mkOption { type = types.str; default = "rss.${cfg.domain}"; }; + secrets.admin-password = mkOption { type = types.str; description = "path to file containing admin password"; }; + }; + + config = mkIf cfg.enable { + services.freshrss = { + enable = true; + virtualHost = cfg.realHost; + baseUrl = "https://${cfg.realHost}"; + + defaultUser = "admin"; + passwordFile = cfg.secrets.admin-password; + + database = { + type = "pgsql"; + host = "/run/postgresql"; + }; + }; + + environment.persistence."/persist".directories = [ + "/var/lib/freshrss" + ]; + + services.nginx.virtualHosts.${cfg.realHost} = { + forceSSL = true; + useACMEHost = cfg.domain; + }; + }; +} |