mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-14 14:10:33 +03:00
treewide: use optionalString instead of 'then ""'
This commit is contained in:
parent
e9e3f2e736
commit
f3719756b5
53 changed files with 101 additions and 116 deletions
|
@ -70,11 +70,10 @@ let
|
|||
let
|
||||
val = if item.freeform != null then item.freeform else item.tristate;
|
||||
in
|
||||
if val == null
|
||||
then ""
|
||||
else if (item.optional)
|
||||
optionalString (val != null)
|
||||
(if (item.optional)
|
||||
then "${key}? ${mkValue val}\n"
|
||||
else "${key} ${mkValue val}\n";
|
||||
else "${key} ${mkValue val}\n");
|
||||
|
||||
mkConf = cfg: concatStrings (mapAttrsToList mkConfigLine cfg);
|
||||
in mkConf exprs;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue