From aa081e8ebbfbf8914f68d1da2e2f511e2a00810f Mon Sep 17 00:00:00 2001 From: derped Date: Thu, 21 Nov 2024 13:05:30 +0100 Subject: [PATCH] tt-rss: init service --- machines/Ophanim/options.nix | 5 +++++ services/nginx_vHosts/tt-rss.nix | 15 +++++++++++++++ services/tt-rss.nix | 21 +++++++++++++++++++++ 3 files changed, 41 insertions(+) create mode 100644 services/nginx_vHosts/tt-rss.nix create mode 100644 services/tt-rss.nix diff --git a/machines/Ophanim/options.nix b/machines/Ophanim/options.nix index 3a6269e..cea24e2 100644 --- a/machines/Ophanim/options.nix +++ b/machines/Ophanim/options.nix @@ -46,6 +46,7 @@ in "nextcloud" "nginx" "openssh" + "tt-rss" ]; vHosts = let @@ -74,6 +75,10 @@ in domain = "food.${base}"; service = "tandoor"; } + { + domain = "feed.${base}"; + service = "tt-rss"; + } ]; firewall = { enable = true; diff --git a/services/nginx_vHosts/tt-rss.nix b/services/nginx_vHosts/tt-rss.nix new file mode 100644 index 0000000..7dc596b --- /dev/null +++ b/services/nginx_vHosts/tt-rss.nix @@ -0,0 +1,15 @@ +{ + options, + config, + lib, + pkgs, + ... +}: +with lib; +if config.services.tt-rss.enable then + { + enableACME = true; + forceSSL = true; + } +else + { } diff --git a/services/tt-rss.nix b/services/tt-rss.nix new file mode 100644 index 0000000..62384f2 --- /dev/null +++ b/services/tt-rss.nix @@ -0,0 +1,21 @@ +{ + config, + lib, + ... +}: +with lib; +mkIf (elem "tt-rss" config.machine.services) ({ + services.tt-rss = + let + fqdn = ((findFirst (s: s.service == "tt-rss") { domain = null; } config.machine.vHosts)).domain; + in + { + enable = true; + registration.enable = false; + selfUrlPath = "https://${fqdn}"; + virtualHost = fqdn; + database = { + type = "mysql"; + }; + }; +})