set up tdarr

This commit is contained in:
Ingolf Wagner 2023-04-11 10:42:00 +02:00
parent 23f2632837
commit c84eef3218
Signed by: palo
GPG key ID: 76BF5F1928B9618B
4 changed files with 60 additions and 4 deletions

View file

@ -27,6 +27,7 @@ let
"grafana.pepe" = hosts.pepe;
"prometheus.pepe" = hosts.pepe;
"tts.pepe" = hosts.pepe;
"tdarr.pepe" = hosts.pepe;
};
network = "private";
in

View file

@ -32,6 +32,7 @@
./telegraf.nix
./home-display.nix
./tdarr.nix
];

View file

@ -15,10 +15,10 @@
mustache = "${pkgs.mustache-go}/bin/mustache";
jq = "${pkgs.jq}/bin/jq";
index_html_template = refreshSeconds: pkgs.writeText "index_html.template" ''
<html>
<head><meta http-equiv="refresh" content="${toString refreshSeconds}"></head>
<body>{{ date }}</body>
</html>
<html>
<head><meta http-equiv="refresh" content="${toString refreshSeconds}"></head>
<body>{{ date }}</body>
</html>
'';
in

View file

@ -0,0 +1,54 @@
{ config, lib, pkgs, ... }:
{
users.users.tdarr = {
isNormalUser = true;
group = "syncthing";
};
# https://docs.tdarr.io/docs/installation/docker/run-compose
virtualisation.oci-containers = {
backend = "podman";
containers.tdarr = {
volumes = [
"/srv/tdarr/server:/app/server"
"/srv/tdarr/configs:/app/configs"
"/srv/tdarr/logs:/app/logs"
"/srv/tdarr/transcode_cache:/temp"
"/media/syncthing/media:/media"
];
environment = {
serverIP = "0.0.0.0";
serverPort = "8266";
webUIPort = "8265";
internalNode = "false";
inContainer = "true";
nodeName = "ServerNode";
TZ = "Europe/London";
PGID = "237";
};
ports = [
"8265:8265" # WebUI
"8266:8266" # server port
];
image = "ghcr.io/haveagitgat/tdarr:latest"; # Warning: if the tag does not change, the image will not be updated
extraOptions = [ "--network=bridge" ];
};
};
networking.firewall.allowedTCPPorts = [ 8266 ];
networking.firewall.allowedUDPPorts = [ 8266 ];
services.nginx.virtualHosts."tdarr.pepe.private" = {
serverAliases = [ "tdarr.pepe" ];
extraConfig = ''
allow ${config.tinc.private.subnet};
deny all;
'';
locations."/" = {
proxyPass = "http://localhost:8265";
proxyWebsockets = true;
};
};
}