transmission: cleanup

feature/hass
Ingolf Wagner 2020-03-21 16:35:58 +08:00
parent adcf1e0dac
commit e7ffcc1435
Signed by: palo
GPG Key ID: 76BF5F1928B9618B
4 changed files with 2 additions and 140 deletions

View File

@ -43,13 +43,6 @@ in {
config = { config, pkgs, lib, ... }: {
# provide password file for database with proper rights
#krops.userKeys."nextcloud" = {
# user = "nextcloud";
# source = toString <secrets/nextcloud/database_password>;
# requiredBy = [ "nginx.service" ];
#};
# send log to host systems graylog (use tinc or wireguard if host is not graylog)
services.SystemdJournal2Gelf.enable = true;
services.SystemdJournal2Gelf.graylogServer = "${hostAddress}:11201";
@ -95,6 +88,8 @@ in {
# 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 =
(pkgs.writers.writeBash "torrent-finished" ''

View File

@ -10,7 +10,6 @@
./services/lektor.nix
./services/samba-share.nix
./services/sshd.nix
./services/transmission.nix
./services/videoencoder.nix
./programs/browser.nix

View File

@ -1,126 +0,0 @@
{ config, lib, ... }:
with lib;
let
cfg = config.services.custom.transmission;
in {
options.services.custom.transmission = {
enable = lib.mkEnableOption "transmission";
home = lib.mkOption {
type = lib.types.path;
description = "where the configs are";
};
store = lib.mkOption {
type = lib.types.path;
description = "where to store";
};
hosts = lib.mkOption {
type = lib.types.str;
description = "allowed hostnames";
};
whitelist = lib.mkOption {
type = lib.types.str;
description = "Ip to listen to";
};
user = lib.mkOption {
type = lib.types.str;
description = "user to login";
};
password = lib.mkOption {
type = lib.types.str;
description = "password to login";
};
port = mkOption {
type = with types; int;
default = 51413;
description = ''
forwarded Port
'';
};
};
config = lib.mkIf cfg.enable {
# because 2.94 is not supported by pass the popcorn
#nixpkgs.config.packageOverrides = pkgs: {
# transmission =
# (pkgs.transmission.overrideAttrs (old: rec {
# version = "2.93";
# src = pkgs.fetchurl {
# url = "https://github.com/transmission/transmission-releases/raw/master/transmission-2.93.tar.xz";
# sha256 = "02xrp49gsv4jkbzp37qrwlnb9nlja08s92dyvgdbr6a4187945c8";
# };
# }));
#};
services.transmission = {
enable = true;
home = "${cfg.home}";
settings = {
# Downloads
download-dir = "${cfg.store}/downloads";
incomplete-dir-enabled = true;
incomplete-dir = "${cfg.store}/incomplete";
# RPC = UI connection
rpc-whitelist = "${cfg.whitelist}";
rpc-host-whitelist = "${cfg.hosts}";
rpc-user = "${cfg.user}";
rpc-username = "${cfg.user}";
rpc-password = "${cfg.password}";
# Start torrents as soon as they are added
start-added-torrents = true;
# Encryption may help get around some ISP filtering,
# but at the cost of slightly higher CPU use.
# 0 = Prefer unencrypted connections,
# 1 = Prefer encrypted connections,
# 2 = Require encrypted connections; default = 1)
encryption = 2;
# Enable Local Peer Discovery (LPD).
lpd-enabled = true;
# Enable UPnP or NAT-PMP.
peer-port = cfg.port;
port-forwarding-enabled = true;
# "normal" speed limits
speed-limit-down-enabled = true;
speed-limit-down = 800;
speed-limit-up-enabled = true;
speed-limit-up = 50;
upload-slots-per-torrent = 8;
# Queuing
# When true, Transmission will only download
# download-queue-size non-stalled torrents at once.
download-queue-enabled = true;
download-queue-size = 1;
# When true, torrents that have not shared data for
# queue-stalled-minutes are treated as 'stalled'
# and are not counted against the queue-download-size
# and seed-queue-size limits.
queue-stalled-enabled = true;
queue-stalled-minutes = 60;
# When true. Transmission will only seed seed-queue-size
# non-stalled torrents at once.
seed-queue-enabled = true;
seed-queue-size = 10;
# umask of the moves that got downloaded
umask = 18;
};
};
};
}

View File

@ -66,9 +66,6 @@
class surfing commit 30%
match tcp sports 0:1023 # include TCP traffic from port 0-1023
class torrent
match tcp dports ${toString config.services.custom.transmission.port}
interface ${interface} world-out output rate ${output} ${
lib.optionalString useBalancedForExperimenting "balanced"
}
@ -85,9 +82,6 @@
class surfing commit 5%
match tcp dports 0:1023 # include TCP traffic to port 0-1023
class torrent
match tcp sports ${toString config.services.custom.transmission.port}
# ------------------- tinc
interface tinc.private tinc bidirectional input rate ${tincInput} output rate ${tincOutput} ${