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/games | |
parent | 175e9d1f00c41b49606e4eacbc1bfe396641e90f (diff) |
treewide: use optional instead of 'then []'
Diffstat (limited to 'nixos/modules/services/games')
-rw-r--r-- | nixos/modules/services/games/factorio.nix | 2 | ||||
-rw-r--r-- | nixos/modules/services/games/freeciv.nix | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/nixos/modules/services/games/factorio.nix b/nixos/modules/services/games/factorio.nix index 9b15cac149d5..b349ffa2375f 100644 --- a/nixos/modules/services/games/factorio.nix +++ b/nixos/modules/services/games/factorio.nix @@ -294,6 +294,6 @@ in }; }; - networking.firewall.allowedUDPPorts = if cfg.openFirewall then [ cfg.port ] else []; + networking.firewall.allowedUDPPorts = optional cfg.openFirewall cfg.port; }; } diff --git a/nixos/modules/services/games/freeciv.nix b/nixos/modules/services/games/freeciv.nix index f33ea5c08a27..bba27ae4cb5f 100644 --- a/nixos/modules/services/games/freeciv.nix +++ b/nixos/modules/services/games/freeciv.nix @@ -16,7 +16,7 @@ let generate = name: value: let mkParam = k: v: if v == null then [] - else if isBool v then if v then [("--"+k)] else [] + else if isBool v then optional v ("--"+k) else [("--"+k) v]; mkParams = k: v: map (mkParam k) (if isList v then v else [v]); in escapeShellArgs (concatLists (concatLists (mapAttrsToList mkParams value))); |