diff options
author | Felix Buehler <account@buehler.rocks> | 2023-06-25 11:47:43 +0200 |
---|---|---|
committer | Anderson Torres <torres.anderson.85@protonmail.com> | 2023-06-25 09:11:40 -0300 |
commit | 933a41a73fe2174b90cabb7d671ee2cc5658701a (patch) | |
tree | 1f8228d1369ab51c644a47ab269fb9c638553752 /nixos/modules/services/security/tor.nix | |
parent | 175e9d1f00c41b49606e4eacbc1bfe396641e90f (diff) | |
download | nixpkgs-933a41a73fe2174b90cabb7d671ee2cc5658701a.tar nixpkgs-933a41a73fe2174b90cabb7d671ee2cc5658701a.tar.gz nixpkgs-933a41a73fe2174b90cabb7d671ee2cc5658701a.tar.bz2 nixpkgs-933a41a73fe2174b90cabb7d671ee2cc5658701a.tar.lz nixpkgs-933a41a73fe2174b90cabb7d671ee2cc5658701a.tar.xz nixpkgs-933a41a73fe2174b90cabb7d671ee2cc5658701a.tar.zst nixpkgs-933a41a73fe2174b90cabb7d671ee2cc5658701a.zip |
treewide: use optional instead of 'then []'
Diffstat (limited to 'nixos/modules/services/security/tor.nix')
-rw-r--r-- | nixos/modules/services/security/tor.nix | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/nixos/modules/services/security/tor.nix b/nixos/modules/services/security/tor.nix index 2aa2964f881..9e786eb2bf0 100644 --- a/nixos/modules/services/security/tor.nix +++ b/nixos/modules/services/security/tor.nix @@ -769,7 +769,7 @@ in }; options.SOCKSPort = mkOption { description = lib.mdDoc (descriptionGeneric "SOCKSPort"); - default = if cfg.settings.HiddenServiceNonAnonymousMode == true then [{port = 0;}] else []; + default = lib.optionals cfg.settings.HiddenServiceNonAnonymousMode [{port = 0;}]; defaultText = literalExpression '' if config.${opt.settings}.HiddenServiceNonAnonymousMode == true then [ { port = 0; } ] @@ -897,8 +897,7 @@ in allowedTCPPorts = concatMap (o: if isInt o && o > 0 then [o] - else if o ? "port" && isInt o.port && o.port > 0 then [o.port] - else [] + else optionals (o ? "port" && isInt o.port && o.port > 0) [o.port] ) (flatten [ cfg.settings.ORPort cfg.settings.DirPort |