From 28debdc44b73247d545654af2d7c40c69881a856 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sun, 30 Jul 2023 02:35:51 +0300 Subject: [PATCH] transmission daemon setup and tui --- config/transmission-daemon/settings.json | 68 +++++++++++++++++++ hosts/sakotop/configuration.nix | 5 +- modules/desktop/apps/transmission/daemon.nix | 16 ----- modules/desktop/apps/transmission/default.nix | 14 +++- .../desktop/apps/transmission/remote-tui.nix | 16 +++++ 5 files changed, 100 insertions(+), 19 deletions(-) create mode 100644 config/transmission-daemon/settings.json delete mode 100644 modules/desktop/apps/transmission/daemon.nix create mode 100644 modules/desktop/apps/transmission/remote-tui.nix diff --git a/config/transmission-daemon/settings.json b/config/transmission-daemon/settings.json new file mode 100644 index 00000000..5d62c795 --- /dev/null +++ b/config/transmission-daemon/settings.json @@ -0,0 +1,68 @@ +{ + "alt-speed-down": 50, + "alt-speed-enabled": false, + "alt-speed-time-begin": 540, + "alt-speed-time-day": 127, + "alt-speed-time-enabled": false, + "alt-speed-time-end": 1020, + "alt-speed-up": 50, + "bind-address-ipv4": "0.0.0.0", + "bind-address-ipv6": "::", + "blocklist-enabled": false, + "blocklist-url": "http://www.example.com/blocklist", + "cache-size-mb": 4, + "dht-enabled": true, + "download-dir": "/home/sako/Downloads/torrents", + "download-queue-enabled": true, + "download-queue-size": 5, + "encryption": 1, + "idle-seeding-limit": 30, + "idle-seeding-limit-enabled": false, + "incomplete-dir": "/home/sako/Downloads/torrents/imcomplete", + "incomplete-dir-enabled": true, + "lpd-enabled": false, + "message-level": 2, + "peer-congestion-algorithm": "", + "peer-id-ttl-hours": 6, + "peer-limit-global": 200, + "peer-limit-per-torrent": 50, + "peer-port": 51413, + "peer-port-random-high": 65535, + "peer-port-random-low": 49152, + "peer-port-random-on-start": false, + "peer-socket-tos": "default", + "pex-enabled": true, + "port-forwarding-enabled": true, + "preallocation": 1, + "prefetch-enabled": true, + "queue-stalled-enabled": true, + "queue-stalled-minutes": 30, + "ratio-limit": 2, + "ratio-limit-enabled": false, + "rename-partial-files": true, + "rpc-authentication-required": false, + "rpc-bind-address": "0.0.0.0", + "rpc-enabled": true, + "rpc-host-whitelist": "", + "rpc-host-whitelist-enabled": true, + "rpc-password": "{d7882a3818f36fee8c4cf1068c40af1270fd56366px7nLqg", + "rpc-port": 9091, + "rpc-url": "/transmission/", + "rpc-username": "", + "rpc-whitelist": "127.0.0.1,::1", + "rpc-whitelist-enabled": true, + "scrape-paused-torrents-enabled": true, + "script-torrent-done-enabled": false, + "script-torrent-done-filename": "", + "seed-queue-enabled": false, + "seed-queue-size": 10, + "speed-limit-down": 100, + "speed-limit-down-enabled": false, + "speed-limit-up": 100, + "speed-limit-up-enabled": false, + "start-added-torrents": true, + "trash-original-torrent-files": false, + "umask": 18, + "upload-slots-per-torrent": 14, + "utp-enabled": true +} diff --git a/hosts/sakotop/configuration.nix b/hosts/sakotop/configuration.nix index 141a21b4..4c1af7bc 100644 --- a/hosts/sakotop/configuration.nix +++ b/hosts/sakotop/configuration.nix @@ -29,7 +29,10 @@ nemo.enable = true; keepassxc.enable = true; nicotineplus.enable = true; - transmission.enable = true; + transmission = { + enable = true; + tui = true; + }; }; chat = { discord.enable = true; diff --git a/modules/desktop/apps/transmission/daemon.nix b/modules/desktop/apps/transmission/daemon.nix deleted file mode 100644 index c8a787fa..00000000 --- a/modules/desktop/apps/transmission/daemon.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ outputs, options, config, lib, pkgs, ...}: -with lib; -let - cfg = config.modules.desktop.apps.transmission.daemon; -in -{ - options.modules.desktop.apps.transmission.daemon = { - enable = mkEnableOption false; - }; - - config = mkIf cfg.enable { - services.transmission = { - enable = true; - }; - }; -} diff --git a/modules/desktop/apps/transmission/default.nix b/modules/desktop/apps/transmission/default.nix index 1de31f4d..5400c135 100644 --- a/modules/desktop/apps/transmission/default.nix +++ b/modules/desktop/apps/transmission/default.nix @@ -5,7 +5,7 @@ let in { imports = [ - ./daemon.nix + ./remote-tui.nix ]; options.modules.desktop.apps.transmission = { enable = mkEnableOption false; @@ -14,7 +14,17 @@ in config = mkIf cfg.enable { #TODO(sako):: figure out service users.users.sako.packages = with pkgs; [ - transmission-gtk + transmission ]; + + home-manager.users.sako = { pkgs, ...}: { + xdg.configFile = { + transmission-daemon = { + source = ../../../../config/transmission-daemon; + recursive = true; + }; + }; + }; + }; } diff --git a/modules/desktop/apps/transmission/remote-tui.nix b/modules/desktop/apps/transmission/remote-tui.nix new file mode 100644 index 00000000..9b4083e0 --- /dev/null +++ b/modules/desktop/apps/transmission/remote-tui.nix @@ -0,0 +1,16 @@ +{ outputs, options, config, lib, pkgs, ...}: +with lib; +let + cfg = config.modules.desktop.apps.transmission.tui; +in +{ + options.modules.desktop.apps.transmission= { + tui = mkEnableOption false; + }; + + config = mkIf cfg { + users.users.sako.packages = with pkgs; [ + stig + ]; + }; +}