treewide: replace "yes" else "no" usages to lib.boolToYesNo
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
|
||||
let
|
||||
inherit (lib)
|
||||
boolToYesNo
|
||||
concatStringsSep
|
||||
literalExpression
|
||||
mapAttrsToList
|
||||
@@ -21,16 +22,15 @@ let
|
||||
;
|
||||
libDir = "/var/lib/bacula";
|
||||
|
||||
yes_no = bool: if bool then "yes" else "no";
|
||||
tls_conf =
|
||||
tls_cfg:
|
||||
optionalString tls_cfg.enable (
|
||||
concatStringsSep "\n" (
|
||||
[ "TLS Enable = yes;" ]
|
||||
++ optional (tls_cfg.require != null) "TLS Require = ${yes_no tls_cfg.require};"
|
||||
++ optional (tls_cfg.require != null) "TLS Require = ${boolToYesNo tls_cfg.require};"
|
||||
++ optional (tls_cfg.certificate != null) ''TLS Certificate = "${tls_cfg.certificate}";''
|
||||
++ [ ''TLS Key = "${tls_cfg.key}";'' ]
|
||||
++ optional (tls_cfg.verifyPeer != null) "TLS Verify Peer = ${yes_no tls_cfg.verifyPeer};"
|
||||
++ optional (tls_cfg.verifyPeer != null) "TLS Verify Peer = ${boolToYesNo tls_cfg.verifyPeer};"
|
||||
++ optional (
|
||||
tls_cfg.allowedCN != [ ]
|
||||
) "TLS Allowed CN = ${concatStringsSep " " (tls_cfg.allowedCN)};"
|
||||
|
||||
Reference in New Issue
Block a user