guixsd-config

GuixSD configs for my systems
Log | Files | Refs

commit 8de2ab4e8612e3f5709b95ba4453a2586e9ee772
parent c2b82e94f08c7ae64ae129a5ca34f24ead114534
Author: Vineet Kumar <git@vineetk.net>
Date:   Thu,  2 Apr 2026 12:03:38 -0400

saklas: replace transmission with rtorrent

Diffstat:
Aepistemia/packages/bittorrent.scm | 18++++++++++++++++++
Mepistemia/systems/saklas.scm | 52++++++++++++++++++++++++++++++++++------------------
2 files changed, 52 insertions(+), 18 deletions(-)

diff --git a/epistemia/packages/bittorrent.scm b/epistemia/packages/bittorrent.scm @@ -0,0 +1,18 @@ +(define-module (epistemia packages bittorrent) + #:use-module (guix gexp) + #:use-module (guix packages) + #:use-module (guix utils) + #:use-module (gnu packages bittorrent) + #:use-module (gnu packages xml)) + +;; upstream rtorrent includes neither xmlrpc-c nor tinyxml2 +;; so, using the scgi socket errors out with other tools +;; tinyxml2 is used instead of xmlrpc-c for working utf8 +(define-public rtorrent-xmlrpc + (package + (inherit rtorrent) + (name "rtorrent-xmlrpc") + (inputs (modify-inputs (package-inputs rtorrent) + (append tinyxml2))) + (arguments + (list #:configure-flags #~'("--with-xmlrpc-tinyxml2"))))) diff --git a/epistemia/systems/saklas.scm b/epistemia/systems/saklas.scm @@ -23,6 +23,7 @@ #:use-module (gnu system accounts) #:use-module (guix) #:use-module (guix gexp) + #:use-module (guix transformations) #:use-module (guix utils) #:use-module (nongnu packages linux) #:use-module (nongnu system linux-initrd) @@ -31,6 +32,7 @@ #:use-module (epistemia systems linux-initrd) #:use-module (epistemia services age-secret) #:use-module (epistemia services zfs) + #:use-module (epistemia packages bittorrent) #:use-module (epistemia packages zfs) #:use-module (ice-9 format)) @@ -194,15 +196,22 @@ table inet filter { (comment "Vineet") (shell (file-append bash "/bin/bash")) (group "users") - (supplementary-groups '("wheel" "git"))) + (supplementary-groups '("wheel" "git" "torrents"))) (user-account (name "git") (comment "git account") - (shell (file-append git "/bin/git-shell")) (group "git") + (shell (file-append git "/bin/git-shell")) (home-directory "/data/src/bare") (system? #t)) (user-account + (name "torrents") + (comment "torrenting account") + (group "torrents") + (shell "/dev/null") + (home-directory "/var/empty") + (system? #t)) + (user-account (name "vmail") (comment "virtual mail account") (group "vmail") @@ -213,6 +222,8 @@ table inet filter { (groups (cons* (user-group (name "git")) (user-group + (name "torrents")) + (user-group (name "vmail")) %base-groups)) @@ -383,22 +394,27 @@ rpz: name: \"hagezi.ultimate\" zonefile: \"hagezi.ultimate\" url: https://raw.githubusercontent.com/hagezi/dns-blocklists/main/rpz/ultimate.txt"))) - (service transmission-daemon-service-type - (transmission-daemon-configuration - (rpc-whitelist-enabled? #t) - (rpc-whitelist '("::1" - "127.0.0.1" - "10.0.13.*")) - (download-dir "/data/torrents/complete/other") - (incomplete-dir-enabled? #t) - (incomplete-dir "/data/torrents/incomplete") - (watch-dir-enabled? #t) - (watch-dir "/data/torrents/watch") - (trash-original-torrent-files? #f) - (peer-port-random-on-start? #f) - (peer-port 51413) - (port-forwarding-enabled? #f) - (blocklist-enabled? #f))) + (simple-service 'rtorrent + shepherd-root-service-type + (list + (shepherd-service + (provision '(rtorrent)) + (requirement '(user-processes loopback syslogd)) + (start #~(make-forkexec-constructor + (list #$(file-append rtorrent-xmlrpc "/bin/rtorrent") + "-n" + "-b" "162.55.242.220" + "-p" "51413-51413" + "-d" "/data/torrents/complete/other" + "-s" "/data/torrents/rtorrent" + "-o" (string-append "system.umask.set=0002," + "dht.mode.set=disable," + "protocol.pex.set=no," + "network.scgi.open_local=/data/torrents/rtorrent/rtorrent.sock," + "system.daemon.set=true")) + #:user "torrents" #:group "torrents")) + (stop #~(make-kill-destructor)) + (documentation "Run rtorrent in headless mode (only xmlrpc).")))) (service wireguard-service-type (wireguard-configuration (interface "wg1")