From 38bc6ac8f9d1b49b35ca54ec0f4d727b513db363 Mon Sep 17 00:00:00 2001 From: diniamo Date: Tue, 29 Oct 2024 15:39:47 +0100 Subject: [PATCH] nixos/transmission: fix the type of `settings.umask` --- nixos/modules/services/torrent/transmission.nix | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/nixos/modules/services/torrent/transmission.nix b/nixos/modules/services/torrent/transmission.nix index 23f94d92042f..4d44ee56becd 100644 --- a/nixos/modules/services/torrent/transmission.nix +++ b/nixos/modules/services/torrent/transmission.nix @@ -176,13 +176,18 @@ in description = "Executable to be run at torrent completion."; }; umask = mkOption { - type = types.str; - default = "022"; + type = types.either types.int types.str; + default = if cfg.package == pkgs.transmission_3 then 18 else "022"; + defaultText = literalExpression "if cfg.package == pkgs.transmission_3 then 18 else \"022\""; description = '' Sets transmission's file mode creation mask. See the umask(2) manpage for more information. Users who want their saved torrents to be world-writable - may want to set this value to `000`. + may want to set this value to 0/`"000"`. + + Keep in mind, that if you are using Transmission 3, this has to + be passed as a base 10 integer, whereas Transmission 4 takes + an octal number in a string instead. ''; }; utp-enabled = mkOption {