From 7099f0b01ef073a335f168d1bb8cbd0f2a3e5575 Mon Sep 17 00:00:00 2001 From: eyjhb Date: Sat, 19 Apr 2025 17:26:53 +0200 Subject: [PATCH] adds drtvrss --- machines/gerd.nix | 1 + machines/gerd/services/drtvrss.nix | 55 ++++++++++++++++++++++++++++++ shared/sources/sources.json | 12 +++++++ 3 files changed, 68 insertions(+) create mode 100644 machines/gerd/services/drtvrss.nix diff --git a/machines/gerd.nix b/machines/gerd.nix index 00678c2..0715de4 100644 --- a/machines/gerd.nix +++ b/machines/gerd.nix @@ -29,6 +29,7 @@ ./gerd/services/rallly ./gerd/services/notify ./gerd/services/drasl.nix + ./gerd/services/drtvrss.nix ./gerd/services/monitoring ]; diff --git a/machines/gerd/services/drtvrss.nix b/machines/gerd/services/drtvrss.nix new file mode 100644 index 0000000..5981970 --- /dev/null +++ b/machines/gerd/services/drtvrss.nix @@ -0,0 +1,55 @@ +{ config, lib, ... }: + +let + sources = import ./../../../shared/sources; + + flake-compat = sources.flake-compat; + drtvrss = import flake-compat { src = sources.drtvrss; }; + + svc_domain = "drtv.${config.mine.shared.settings.domain}"; + + port = 8125; +in { + imports = [ + # (builtins.trace drtvrss.defaultNix.nixosModules.x86_64-linux.default drtvrss.defaultNix.nixosModules.default) + drtvrss.defaultNix.nixosModules.x86_64-linux.default + ]; + + services.drtvrss = { + enable = true; + host = "127.0.0.1:${builtins.toString port}"; + base_url = "https://${svc_domain}"; + klagemail = "rasmus@rend.al"; + recommended_shows = [ "matador_130149" ]; + }; + + systemd.services.drtvrss.confinement.enable = lib.mkForce false; + + # nginx + services.nginx.virtualHosts."${svc_domain}" = { + forceSSL = true; + enableACME = true; + + locations."/".proxyPass = "http://localhost:${builtins.toString port}"; + }; + + # meta + mine.shared.meta.drtvrss = rec { + name = "DRTV RSS"; + description = '' + Alternative frontend for DRTV, whithout the requirement to login + the ability to generate RSS feeds of your favorite shows. + ''; + url = "https://${svc_domain}"; + + package = { + name = "drtvrss"; + version = "v0.0.1"; + meta = with lib; { + description = "DRTVRSS"; + license = licenses.agpl3Only; + homepage = "https://github.com/RasmusRendal/drtvrss"; + platforms = platforms.all; + }; + }; + }; +} diff --git a/shared/sources/sources.json b/shared/sources/sources.json index 7701c85..1a60706 100644 --- a/shared/sources/sources.json +++ b/shared/sources/sources.json @@ -30,6 +30,18 @@ "url_template": "https://github.com/unmojang/drasl/archive/.tar.gz", "version": "v3.0.0" }, + "drtvrss": { + "branch": "main", + "description": "RSS feeds for DRTV", + "homepage": null, + "owner": "RasmusRendal", + "repo": "drtvrss", + "rev": "1234121a3f615d80bc18107768182fb43df0bbac", + "sha256": "0yxarbbsj4giyszc8pf64d0gy9qsld9skgdxxfgygrgk2wspycnc", + "type": "tarball", + "url": "https://github.com/RasmusRendal/drtvrss/archive/1234121a3f615d80bc18107768182fb43df0bbac.tar.gz", + "url_template": "https://github.com///archive/.tar.gz" + }, "flake-compat": { "branch": "master", "description": null,