Merge pull request #222080 from Stunkymonkey/nixos-optionalString
This commit is contained in:
@@ -169,11 +169,11 @@ in
|
||||
else (concatStrings (map (i: "--interface=\"${i}\"")
|
||||
interfaces))} \
|
||||
-h "${hostKey}" \
|
||||
${if !syslog then "--no-syslog" else ""} \
|
||||
${optionalString (!syslog) "--no-syslog" } \
|
||||
${if passwordAuthentication then "--password" else "--no-password" } \
|
||||
${if publicKeyAuthentication then "--publickey" else "--no-publickey" } \
|
||||
${if rootLogin then "--root-login" else "--no-root-login" } \
|
||||
${if loginShell != null then "--login-shell=\"${loginShell}\"" else "" } \
|
||||
${optionalString (loginShell != null) "--login-shell=\"${loginShell}\"" } \
|
||||
${if srpKeyExchange then "--srp-keyexchange" else "--no-srp-keyexchange" } \
|
||||
${if !tcpForwarding then "--no-tcpip-forward" else "--tcpip-forward"} \
|
||||
${if x11Forwarding then "--x11-forward" else "--no-x11-forward" } \
|
||||
|
||||
@@ -474,10 +474,10 @@ in
|
||||
mkdir -m 0755 -p "$(dirname '${k.path}')"
|
||||
ssh-keygen \
|
||||
-t "${k.type}" \
|
||||
${if k ? bits then "-b ${toString k.bits}" else ""} \
|
||||
${if k ? rounds then "-a ${toString k.rounds}" else ""} \
|
||||
${if k ? comment then "-C '${k.comment}'" else ""} \
|
||||
${if k ? openSSHFormat && k.openSSHFormat then "-o" else ""} \
|
||||
${optionalString (k ? bits) "-b ${toString k.bits}"} \
|
||||
${optionalString (k ? rounds) "-a ${toString k.rounds}"} \
|
||||
${optionalString (k ? comment) "-C '${k.comment}'"} \
|
||||
${optionalString (k ? openSSHFormat && k.openSSHFormat) "-o"} \
|
||||
-f "${k.path}" \
|
||||
-N ""
|
||||
fi
|
||||
@@ -550,7 +550,7 @@ in
|
||||
'') cfg.ports}
|
||||
|
||||
${concatMapStrings ({ port, addr, ... }: ''
|
||||
ListenAddress ${addr}${if port != null then ":" + toString port else ""}
|
||||
ListenAddress ${addr}${optionalString (port != null) (":" + toString port)}
|
||||
'') cfg.listenAddresses}
|
||||
|
||||
${optionalString cfgc.setXAuthLocation ''
|
||||
|
||||
Reference in New Issue
Block a user