2023-04-11 10:42:00 +02:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
{
|
|
|
|
|
|
|
|
users.users.tdarr = {
|
|
|
|
isNormalUser = true;
|
|
|
|
group = "syncthing";
|
|
|
|
};
|
|
|
|
|
2023-04-19 07:31:34 +02:00
|
|
|
backup.dirs = [
|
|
|
|
"/srv/tdarr/server"
|
|
|
|
"/srv/tdarr/configs"
|
|
|
|
"/srv/tdarr/logs"
|
|
|
|
];
|
|
|
|
|
2023-04-11 10:42:00 +02:00
|
|
|
# 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;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|