summary refs log tree commit diff
path: root/nixos/modules/services/network-filesystems
diff options
context:
space:
mode:
authorArtturi <Artturin@artturin.com>2023-04-20 16:07:30 +0300
committerGitHub <noreply@github.com>2023-04-20 16:07:30 +0300
commitb83db86a9e9ff5b07360e8917c3e007001b06f9c (patch)
tree01bc1eeb7fd3e6c17a4d3649400d8310ce691c59 /nixos/modules/services/network-filesystems
parent2fc54db033c27ffb4f50e35a2079233d7280c9b9 (diff)
parent327b0cff7aedc20a148d245b1182f43800acc1f5 (diff)
downloadnixpkgs-b83db86a9e9ff5b07360e8917c3e007001b06f9c.tar
nixpkgs-b83db86a9e9ff5b07360e8917c3e007001b06f9c.tar.gz
nixpkgs-b83db86a9e9ff5b07360e8917c3e007001b06f9c.tar.bz2
nixpkgs-b83db86a9e9ff5b07360e8917c3e007001b06f9c.tar.lz
nixpkgs-b83db86a9e9ff5b07360e8917c3e007001b06f9c.tar.xz
nixpkgs-b83db86a9e9ff5b07360e8917c3e007001b06f9c.tar.zst
nixpkgs-b83db86a9e9ff5b07360e8917c3e007001b06f9c.zip
Merge pull request #222080 from Stunkymonkey/nixos-optionalString
Diffstat (limited to 'nixos/modules/services/network-filesystems')
-rw-r--r--nixos/modules/services/network-filesystems/openafs/lib.nix4
1 files changed, 2 insertions, 2 deletions
diff --git a/nixos/modules/services/network-filesystems/openafs/lib.nix b/nixos/modules/services/network-filesystems/openafs/lib.nix
index 80628f4dfaf..e5e147a8dc3 100644
--- a/nixos/modules/services/network-filesystems/openafs/lib.nix
+++ b/nixos/modules/services/network-filesystems/openafs/lib.nix
@@ -1,13 +1,13 @@
 { config, lib, ...}:
 
 let
-  inherit (lib) concatStringsSep mkOption types;
+  inherit (lib) concatStringsSep mkOption types optionalString;
 
 in {
 
   mkCellServDB = cellName: db: ''
     >${cellName}
-  '' + (concatStringsSep "\n" (map (dbm: if (dbm.ip != "" && dbm.dnsname != "") then dbm.ip + " #" + dbm.dnsname else "")
+  '' + (concatStringsSep "\n" (map (dbm: optionalString (dbm.ip != "" && dbm.dnsname != "") "${dbm.ip} #${dbm.dnsname}")
                                    db))
      + "\n";