Netconf-Module/junos/protocols.nix

24 lines
524 B
Nix
Raw Normal View History

2024-04-30 16:47:55 +02:00
{ lib, config, ... }:
with lib;
{
options = {
protocols.rstp = mkOption { type = types.listOf types.str; };
netconf.xmls.protocols = mkOption {
type = types.str;
visible = false;
readOnly = true;
};
};
config.netconf.xmls.protocols =
let
rstps = map (intf: "<interface><name>${intf}</name></interface>") config.protocols.rstp;
in
''
<protocols>
<rstp operation="replace">
${concatStringsSep "" rstps}
</rstp>
</protocols>
'';
}