diff --git a/nixos/machines/robi/transmission.nix b/nixos/machines/robi/transmission.nix index 5ac7207..3b6d13d 100644 --- a/nixos/machines/robi/transmission.nix +++ b/nixos/machines/robi/transmission.nix @@ -1,55 +1,9 @@ { lib, pkgs, config, ... }: -# -# cp -avl (to create hardlinks instead of copy) -# ============================================= -# -#┌──────────────────────────────────┐ ┌──────────────────────────────────────┐ -#│/media/torrent/downloads/music ├─────►│/media/syncthing/music/incomming │ -#└──────────────────────────────────┘ └──────────────────────────────────────┘ -#┌──────────────────────────────────┐ ┌──────────────────────────────────────┐ -#│/media/torrent/downloads/movies ├─────►│/media/syncthing/movies/incoming │ -#└──────────────────────────────────┘ └──────────────────────────────────────┘ -#┌──────────────────────────────────┐ ┌──────────────────────────────────────┐ -#│/media/torrent/downloads ├─────►│/media/torrent/incoming │ -#└──────────────────────────────────┘ └──────────────────────────────────────┘ - let - hostInterface = "enp3s0"; hostAddress = "192.168.100.30"; containerAddress = "192.168.100.31"; uiPort = 9091; - - ############################################# - # These are inherited from Transmission. # - # Do not declare these. Just use as needed. # - # # - # TR_APP_VERSION # - # TR_TIME_LOCALTIME # - # TR_TORRENT_DIR # - # TR_TORRENT_HASH # - # TR_TORRENT_ID # - # TR_TORRENT_NAME # - # # - ############################################# - completionScript = - let - copy_map = { - "/media/torrent/downloads/series" = "/media/syncthing/media/incoming/series"; - "/media/torrent/downloads/music" = "/media/syncthing/media/incoming/music"; - "/media/torrent/downloads/movies" = "/media/syncthing/media/incoming/movies"; - "/media/torrent/downloads" = "/media/torrent/incoming"; - }; - copy_script = lib.concatStringsSep "\n" (lib.mapAttrsToList - (source: target: '' - if [[ "$TR_TORRENT_DIR" == "${source}" ]] - then - cp -val "$TR_TORRENT_DIR/$TR_TORRENT_NAME" "${target}/$TR_TORRENT_NAME" - fi - '') - copy_map); - in - pkgs.writers.writeBash "torrent-finished" copy_script; in { @@ -149,13 +103,9 @@ in # Enable UPnP or NAT-PMP. peer-port = 51413; port-forwarding-enabled = false; + # Start torrents as soon as they are added - start-added-torrents = true; - - # notify me when download finished - script-torrent-done-enabled = true; - script-torrent-done-filename = completionScript; }; }; diff --git a/nixos/machines/robi/transmission2.nix b/nixos/machines/robi/transmission2.nix index 02b4613..2e51ac2 100644 --- a/nixos/machines/robi/transmission2.nix +++ b/nixos/machines/robi/transmission2.nix @@ -1,51 +1,6 @@ { lib, pkgs, config, ... }: -# -# cp -avl (to create hardlinks instead of copy) -# ============================================= -# -#┌──────────────────────────────────┐ ┌──────────────────────────────────────┐ -#│/media/torrent2/downloads/music ├─────►│/media/syncthing/music/incomming │ -#└──────────────────────────────────┘ └──────────────────────────────────────┘ -#┌──────────────────────────────────┐ ┌──────────────────────────────────────┐ -#│/media/torrent2/downloads/movies ├─────►│/media/syncthing/movies/incoming │ -#└──────────────────────────────────┘ └──────────────────────────────────────┘ -#┌──────────────────────────────────┐ ┌──────────────────────────────────────┐ -#│/media/torrent2/downloads ├─────►│/media/torrent/incoming │ -#└──────────────────────────────────┘ └──────────────────────────────────────┘ - let uiPort = 9091; - - ############################################# - # These are inherited from Transmission. # - # Do not declare these. Just use as needed. # - # # - # TR_APP_VERSION # - # TR_TIME_LOCALTIME # - # TR_TORRENT_DIR # - # TR_TORRENT_HASH # - # TR_TORRENT_ID # - # TR_TORRENT_NAME # - # # - ############################################# - completionScript = - let - copy_map = { - "/media/torrent/downloads/series" = "/media/syncthing/media/incoming/series"; - "/media/torrent/downloads/music" = "/media/syncthing/media/incoming/music"; - "/media/torrent/downloads/movies" = "/media/syncthing/media/incoming/movies"; - "/media/torrent/downloads" = "/media/torrent/incoming"; - }; - copy_script = lib.concatStringsSep "\n" (lib.mapAttrsToList - (source: target: '' - if [[ "$TR_TORRENT_DIR" == "${source}" ]] - then - cp -val "$TR_TORRENT_DIR/$TR_TORRENT_NAME" "${target}/$TR_TORRENT_NAME" - fi - '') - copy_map); - in - pkgs.writers.writeBash "torrent-finished" copy_script; in { @@ -119,14 +74,10 @@ in # Enable UPnP or NAT-PMP. peer-port = 51413; port-forwarding-enabled = false; + # Start torrents as soon as they are added - start-added-torrents = true; - # notify me when download finished - script-torrent-done-enabled = true; - script-torrent-done-filename = completionScript; - # Encryption preference. # 0 = Prefer unencrypted connections, # 1 = Prefer encrypted connections,