From f3719756b550113c1acbbab00c89a56fb77256f2 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Sat, 24 Jun 2023 20:19:19 +0200 Subject: treewide: use optionalString instead of 'then ""' --- nixos/modules/services/networking/nsd.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'nixos/modules/services/networking/nsd.nix') diff --git a/nixos/modules/services/networking/nsd.nix b/nixos/modules/services/networking/nsd.nix index 09f3bdc7ae07..6db728e7aa5a 100644 --- a/nixos/modules/services/networking/nsd.nix +++ b/nixos/modules/services/networking/nsd.nix @@ -137,8 +137,8 @@ let ''; yesOrNo = b: if b then "yes" else "no"; - maybeString = prefix: x: if x == null then "" else ''${prefix} "${x}"''; - maybeToString = prefix: x: if x == null then "" else ''${prefix} ${toString x}''; + maybeString = prefix: x: optionalString (x != null) ''${prefix} "${x}"''; + maybeToString = prefix: x: optionalString (x != null) ''${prefix} ${toString x}''; forEach = pre: l: concatMapStrings (x: pre + x + "\n") l; -- cgit v1.2.3