From 6bb26431d3fd7696c85b73b3831abf8a89c9be90 Mon Sep 17 00:00:00 2001 From: sefidel Date: Wed, 6 Dec 2023 23:10:39 +0900 Subject: feat(modules/{tt-rss -> rss}): change tt-rss to freshrss --- modules/services/rss.nix | 39 +++++++++++++++++++++++++++++++++++++++ modules/services/tt-rss.nix | 42 ------------------------------------------ 2 files changed, 39 insertions(+), 42 deletions(-) create mode 100644 modules/services/rss.nix delete mode 100644 modules/services/tt-rss.nix (limited to 'modules') 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; + }; + }; +} diff --git a/modules/services/tt-rss.nix b/modules/services/tt-rss.nix deleted file mode 100644 index 4351065..0000000 --- a/modules/services/tt-rss.nix +++ /dev/null @@ -1,42 +0,0 @@ -{ config, lib, pkgs, ... }: - -with lib; -let - cfg = config.modules.services.tt-rss; -in -{ - options.modules.services.tt-rss = { - enable = mkEnableOption "Tiny Tiny RSS Client"; - domain = mkOption { type = types.str; }; - realHost = mkOption { type = types.str; default = "rss.${cfg.domain}"; }; - }; - - config = mkIf cfg.enable { - services.tt-rss = { - enable = true; - virtualHost = cfg.realHost; - selfUrlPath = "https://${cfg.realHost}"; - - themePackages = [ - pkgs.tt-rss-theme-feedly - ]; - - plugins = [ - "auth_internal" - "note" - ]; - - database = { - type = "pgsql"; - password = null; - host = "/run/postgresql"; - }; - - }; - - services.nginx.virtualHosts.${cfg.realHost} = { - forceSSL = true; - useACMEHost = cfg.domain; - }; - }; -} -- cgit 1.4.1