add tdarr
This commit is contained in:
parent
d2008a09e5
commit
56b1c6c29d
4 changed files with 96 additions and 24 deletions
|
@ -17,7 +17,10 @@
|
|||
|
||||
#./borg.nix
|
||||
#./taskwarrior-pushover.nix
|
||||
|
||||
./tdarr.nix
|
||||
#./jellyfin.nix
|
||||
|
||||
#./wireguard.nix
|
||||
|
||||
# logging
|
||||
|
@ -28,7 +31,6 @@
|
|||
./telegraf.nix
|
||||
|
||||
#./home-display.nix
|
||||
#./tdarr.nix
|
||||
|
||||
./rbackup.nix
|
||||
./sync-torrent.nix
|
||||
|
|
|
@ -10,34 +10,34 @@
|
|||
#
|
||||
#
|
||||
|
||||
{pkgs, ...}:
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
environment.systemPackages = [
|
||||
environment.systemPackages = [
|
||||
(pkgs.writers.writeBashBin "torrent-sync" ''
|
||||
set -e
|
||||
set -x
|
||||
set -e
|
||||
set -x
|
||||
|
||||
file_folder=$( realpath "$1" )
|
||||
folder=$( dirname "$file_folder" )
|
||||
file=$( basename "$file_folder" )
|
||||
file_folder=$( realpath "$1" )
|
||||
folder=$( dirname "$file_folder" )
|
||||
file=$( basename "$file_folder" )
|
||||
|
||||
pushd "$folder"
|
||||
${pkgs.transmission}/bin/transmission-create \
|
||||
-t udp://robi.private:6969/announce \
|
||||
-o ~/last.torrent \
|
||||
"$file"
|
||||
popd
|
||||
pushd "$folder"
|
||||
${pkgs.transmission}/bin/transmission-create \
|
||||
-t udp://robi.private:6969/announce \
|
||||
-o ~/last.torrent \
|
||||
"$file"
|
||||
popd
|
||||
|
||||
${pkgs.transmission}/bin/transmission-remote \
|
||||
sync.chungus.private:80 \
|
||||
-a ~/last.torrent \
|
||||
--download-dir "$folder"
|
||||
${pkgs.transmission}/bin/transmission-remote \
|
||||
sync.chungus.private:80 \
|
||||
-a ~/last.torrent \
|
||||
--download-dir "$folder"
|
||||
|
||||
${pkgs.transmission}/bin/transmission-remote \
|
||||
sync.robi.private:80 \
|
||||
-a ~/last.torrent \
|
||||
--download-dir "$folder"
|
||||
${pkgs.transmission}/bin/transmission-remote \
|
||||
sync.robi.private:80 \
|
||||
-a ~/last.torrent \
|
||||
--download-dir "$folder"
|
||||
|
||||
'')
|
||||
];
|
||||
}
|
||||
];
|
||||
}
|
||||
|
|
|
@ -31,6 +31,7 @@ in
|
|||
|
||||
services.transmission = {
|
||||
enable = true;
|
||||
|
||||
settings = {
|
||||
download-dir = "/media";
|
||||
incomplete-dir = "/var/lib/transmission/incomplete"; # todo put this somewhere with frequent snapshots but low keep.
|
||||
|
|
69
nixos/machines/chungus/tdarr.nix
Normal file
69
nixos/machines/chungus/tdarr.nix
Normal file
|
@ -0,0 +1,69 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
{
|
||||
|
||||
# To set password:
|
||||
# nix-shell -p samba --run "smbpasswd -a media"
|
||||
custom.samba-share.enable = true;
|
||||
custom.samba-share.private.media = {
|
||||
folder = "/media";
|
||||
users = "media";
|
||||
};
|
||||
|
||||
users.groups."media".gid = config.ids.gids.transmission;
|
||||
users.users."media" = {
|
||||
uid = config.ids.uids.transmission;
|
||||
group = "media";
|
||||
};
|
||||
|
||||
services.permown."/media" = {
|
||||
owner = "media";
|
||||
group = "media";
|
||||
};
|
||||
|
||||
# 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:/media"
|
||||
];
|
||||
environment = {
|
||||
serverIP = "0.0.0.0";
|
||||
serverPort = "8266";
|
||||
webUIPort = "8265";
|
||||
internalNode = "false";
|
||||
inContainer = "true";
|
||||
nodeName = "ServerNode";
|
||||
TZ = "Europe/London";
|
||||
PUID = toString config.ids.uids.transmission;
|
||||
PGID = toString config.ids.gids.transmission;
|
||||
};
|
||||
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.${config.networking.hostName}.private" = {
|
||||
serverAliases = [ "tdarr.${config.networking.hostName}" ];
|
||||
extraConfig = ''
|
||||
allow ${config.tinc.private.subnet};
|
||||
deny all;
|
||||
'';
|
||||
locations."/" = {
|
||||
proxyPass = "http://localhost:8265";
|
||||
proxyWebsockets = true;
|
||||
};
|
||||
};
|
||||
|
||||
}
|
Loading…
Reference in a new issue