babeld module: support non-boolean default arguments

Previosuly only boolean values would be rendered properly. All other
values would cause an error. Even the example configuration did fail.
This commit is contained in:
Andreas Rammhold 2017-11-10 11:46:11 +01:00
parent 236a7c5452
commit 5d9073747a
No known key found for this signature in database
GPG key ID: E432E410B5E48C86

View file

@ -6,8 +6,10 @@ let
cfg = config.services.babeld;
conditionalBoolToString = value: if (isBool value) then (boolToString value) else (toString value);
paramsString = params:
concatMapStringsSep " " (name: "${name} ${boolToString (getAttr name params)}")
concatMapStringsSep " " (name: "${name} ${conditionalBoolToString (getAttr name params)}")
(attrNames params);
interfaceConfig = name: