summary refs log tree commit diff
path: root/nixos/modules/services/torrent
diff options
context:
space:
mode:
authorGraham Christensen <graham@grahamc.com>2021-12-17 11:14:08 -0500
committerGitHub <noreply@github.com>2021-12-17 11:14:08 -0500
commit06edb74413eb4e4ac56921ef2c038d8f106b15df (patch)
tree897b78ed67fd8ffb0938fc85f52a496ff9785e7c /nixos/modules/services/torrent
parent4edd5c91ca09665e33f705d280a4d9f7f093605f (diff)
parente67a646a925bc3cda86101a3f3afb81db3030ef5 (diff)
downloadnixpkgs-06edb74413eb4e4ac56921ef2c038d8f106b15df.tar
nixpkgs-06edb74413eb4e4ac56921ef2c038d8f106b15df.tar.gz
nixpkgs-06edb74413eb4e4ac56921ef2c038d8f106b15df.tar.bz2
nixpkgs-06edb74413eb4e4ac56921ef2c038d8f106b15df.tar.lz
nixpkgs-06edb74413eb4e4ac56921ef2c038d8f106b15df.tar.xz
nixpkgs-06edb74413eb4e4ac56921ef2c038d8f106b15df.tar.zst
nixpkgs-06edb74413eb4e4ac56921ef2c038d8f106b15df.zip
Merge pull request #148785 from pennae/more-option-doc-staticizing
treewide: more defaultText for options
Diffstat (limited to 'nixos/modules/services/torrent')
-rw-r--r--nixos/modules/services/torrent/peerflix.nix4
-rw-r--r--nixos/modules/services/torrent/rtorrent.nix4
-rw-r--r--nixos/modules/services/torrent/transmission.nix4
3 files changed, 10 insertions, 2 deletions
diff --git a/nixos/modules/services/torrent/peerflix.nix b/nixos/modules/services/torrent/peerflix.nix
index 3e5f80960dc..821c829f6b4 100644
--- a/nixos/modules/services/torrent/peerflix.nix
+++ b/nixos/modules/services/torrent/peerflix.nix
@@ -1,9 +1,10 @@
-{ config, lib, pkgs, ... }:
+{ config, lib, options, pkgs, ... }:
 
 with lib;
 
 let
   cfg = config.services.peerflix;
+  opt = options.services.peerflix;
 
   configFile = pkgs.writeText "peerflix-config.json" ''
     {
@@ -32,6 +33,7 @@ in {
     downloadDir = mkOption {
       description = "Peerflix temporary download directory.";
       default = "${cfg.stateDir}/torrents";
+      defaultText = literalExpression ''"''${config.${opt.stateDir}}/torrents"'';
       type = types.path;
     };
   };
diff --git a/nixos/modules/services/torrent/rtorrent.nix b/nixos/modules/services/torrent/rtorrent.nix
index dd7df623c73..759dcfe2e6c 100644
--- a/nixos/modules/services/torrent/rtorrent.nix
+++ b/nixos/modules/services/torrent/rtorrent.nix
@@ -1,10 +1,11 @@
-{ config, pkgs, lib, ... }:
+{ config, options, pkgs, lib, ... }:
 
 with lib;
 
 let
 
   cfg = config.services.rtorrent;
+  opt = options.services.rtorrent;
 
 in {
   options.services.rtorrent = {
@@ -21,6 +22,7 @@ in {
     downloadDir = mkOption {
       type = types.str;
       default = "${cfg.dataDir}/download";
+      defaultText = literalExpression ''"''${config.${opt.dataDir}}/download"'';
       description = ''
         Where to put downloaded files.
       '';
diff --git a/nixos/modules/services/torrent/transmission.nix b/nixos/modules/services/torrent/transmission.nix
index 9e440e49b50..d12d8aa2398 100644
--- a/nixos/modules/services/torrent/transmission.nix
+++ b/nixos/modules/services/torrent/transmission.nix
@@ -4,6 +4,7 @@ with lib;
 
 let
   cfg = config.services.transmission;
+  opt = options.services.transmission;
   inherit (config.environment) etc;
   apparmor = config.security.apparmor;
   rootDir = "/run/transmission";
@@ -47,11 +48,13 @@ in
           options.download-dir = mkOption {
             type = types.path;
             default = "${cfg.home}/${downloadsDir}";
+            defaultText = literalExpression ''"''${config.${opt.home}}/${downloadsDir}"'';
             description = "Directory where to download torrents.";
           };
           options.incomplete-dir = mkOption {
             type = types.path;
             default = "${cfg.home}/${incompleteDir}";
+            defaultText = literalExpression ''"''${config.${opt.home}}/${incompleteDir}"'';
             description = ''
               When enabled with
               services.transmission.home
@@ -147,6 +150,7 @@ in
           options.watch-dir = mkOption {
             type = types.path;
             default = "${cfg.home}/${watchDir}";
+            defaultText = literalExpression ''"''${config.${opt.home}}/${watchDir}"'';
             description = "Watch a directory for torrent files and add them to transmission.";
           };
           options.watch-dir-enabled = mkOption {