summary refs log tree commit diff
path: root/nixos/modules/services/torrent/rtorrent.nix
diff options
context:
space:
mode:
authorpennae <github@quasiparticle.net>2021-12-05 21:28:49 +0100
committerpennae <github@quasiparticle.net>2021-12-09 01:13:48 +0100
commitfb0e5be84331188a69b3edd31679ca6576edb75a (patch)
tree80d713f568ae02e4a3aed70114bafe46e9fe753f /nixos/modules/services/torrent/rtorrent.nix
parentf6d0b014fe1db9e6edec5485f41a1162136c8a70 (diff)
downloadnixpkgs-fb0e5be84331188a69b3edd31679ca6576edb75a.tar
nixpkgs-fb0e5be84331188a69b3edd31679ca6576edb75a.tar.gz
nixpkgs-fb0e5be84331188a69b3edd31679ca6576edb75a.tar.bz2
nixpkgs-fb0e5be84331188a69b3edd31679ca6576edb75a.tar.lz
nixpkgs-fb0e5be84331188a69b3edd31679ca6576edb75a.tar.xz
nixpkgs-fb0e5be84331188a69b3edd31679ca6576edb75a.tar.zst
nixpkgs-fb0e5be84331188a69b3edd31679ca6576edb75a.zip
treewide: add defaultText for options with simple interpolation defaults
adds defaultText for all options that use `cfg.*` values in their
defaults, but only for interpolations with no extra processing (other
than toString where necessary)
Diffstat (limited to 'nixos/modules/services/torrent/rtorrent.nix')
-rw-r--r--nixos/modules/services/torrent/rtorrent.nix4
1 files changed, 3 insertions, 1 deletions
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.
       '';