From 91c437de6d70abf04493cb59d9c322528af0d0e0 Mon Sep 17 00:00:00 2001 From: ediblerope Date: Wed, 15 Apr 2026 10:17:09 +0100 Subject: [PATCH] =?UTF-8?q?Add=20Tdarr=20transcoding=20manager=20for=20bul?= =?UTF-8?q?k=20H.264=E2=86=92HEVC=20conversion?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Runs Tdarr server with internal node on the mediaserver for managing library-wide re-encoding to save disk space. Web UI at tdarr.nordhammer.it. Co-Authored-By: Claude Opus 4.6 --- common.nix | 1 + services/nginx.nix | 1 + services/tdarr.nix | 48 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 50 insertions(+) create mode 100644 services/tdarr.nix diff --git a/common.nix b/common.nix index d751990..ff44cf0 100644 --- a/common.nix +++ b/common.nix @@ -31,6 +31,7 @@ ./services/fail2ban.nix ./services/authelia.nix ./services/homepage.nix + ./services/tdarr.nix ./services/arr-interconnect.nix ]; diff --git a/services/nginx.nix b/services/nginx.nix index b0ba787..35d30d0 100644 --- a/services/nginx.nix +++ b/services/nginx.nix @@ -103,6 +103,7 @@ in # --- Other --- "games.nordhammer.it" = proxy 8787; "search.nordhammer.it" = proxy 8087; + "tdarr.nordhammer.it" = proxy 8265; # --- Protected by Authelia --- "camera.nordhammer.it" = protectedProxy 1984; diff --git a/services/tdarr.nix b/services/tdarr.nix new file mode 100644 index 0000000..9ef053c --- /dev/null +++ b/services/tdarr.nix @@ -0,0 +1,48 @@ +# services/tdarr.nix — Tdarr transcoding manager +{ config, pkgs, lib, ... }: +{ + config = lib.mkIf (config.networking.hostName == "FredOS-Mediaserver") { + + systemd.services.tdarr-server = { + description = "Tdarr Server"; + after = [ "network.target" ]; + wantedBy = [ "multi-user.target" ]; + + serviceConfig = { + Type = "simple"; + User = "tdarr"; + Group = "media"; + StateDirectory = "tdarr"; + ExecStart = "${pkgs.tdarr-server}/bin/tdarr-server"; + Restart = "on-failure"; + RestartSec = 10; + + # Tdarr server config via environment + Environment = [ + "HOME=/var/lib/tdarr" + "serverIP=0.0.0.0" + "serverPort=8266" + "webUIPort=8265" + "internalNode=true" + "inContainer=false" + "ffmpegVersion=6" + "nodeName=FredOS-Mediaserver" + ]; + }; + }; + + users.users.tdarr = { + isSystemUser = true; + group = "media"; + extraGroups = [ "media" "video" "render" ]; + home = "/var/lib/tdarr"; + }; + + systemd.tmpfiles.rules = [ + "d /var/lib/tdarr 0755 tdarr media -" + "d /var/lib/tdarr/server 0755 tdarr media -" + "d /var/lib/tdarr/configs 0755 tdarr media -" + "d /var/lib/tdarr/logs 0755 tdarr media -" + ]; + }; +}