1
0

firewallgen: add extraText param to set

anything in here is added verbatim to the set definition
This commit is contained in:
Daniel Barlow 2025-03-05 22:36:35 +00:00
parent d6b06abb63
commit 2c7a16d792

View File

@ -10,6 +10,7 @@ let
splitString splitString
hasInfix hasInfix
substring substring
optionalString
; ;
inherit (lib.lists) groupBy; inherit (lib.lists) groupBy;
inherit (lib.attrsets) mapAttrsToList; inherit (lib.attrsets) mapAttrsToList;
@ -56,12 +57,14 @@ let
name, name,
type, type,
elements ? [ ], elements ? [ ],
extraText ? null,
... ...
}: }:
'' ''
set ${name} { set ${name} {
type ${type} type ${type}
${if elements != [ ] then "elements = { ${concatStringsSep ", " (builtins.trace elements elements)} }" else ""} ${if elements != [ ] then "elements = { ${concatStringsSep ", " (builtins.trace elements elements)} }" else ""}
${optionalString (extraText != null) extraText}
} }
''; '';