This repository has been archived on 2025-02-03. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
Netconf-Module/junos/protocols.nix

23 lines
524 B
Nix

{ 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>
'';
}