hostapd literal_or_output use an attrset for dispatch
This commit is contained in:
parent
d2d3af2587
commit
fc03965915
@ -25,13 +25,11 @@ let
|
|||||||
ctrl_interface_group = 0;
|
ctrl_interface_group = 0;
|
||||||
};
|
};
|
||||||
attrs = defaults // params ;
|
attrs = defaults // params ;
|
||||||
literal_or_output = o:
|
literal_or_output = o: ({
|
||||||
let typ = builtins.typeOf o;
|
string = builtins.toJSON;
|
||||||
in if typ == "string"
|
int = builtins.toJSON;
|
||||||
then builtins.toJSON o
|
set = (o: "output(${builtins.toJSON o.service}, ${builtins.toJSON o.path})");
|
||||||
else if typ == "int"
|
}.${builtins.typeOf o}) o;
|
||||||
then builtins.toJSON o
|
|
||||||
else "output(${builtins.toJSON o.service}, ${builtins.toJSON o.path})";
|
|
||||||
format_value = n : v:
|
format_value = n : v:
|
||||||
"${n}={{ ${literal_or_output v} }}";
|
"${n}={{ ${literal_or_output v} }}";
|
||||||
conf =
|
conf =
|
||||||
|
Loading…
Reference in New Issue
Block a user