refactor #1

Merged
lbailly merged 6 commits from refactor into master 2024-05-22 13:34:29 +02:00
Showing only changes of commit 5018ab847c - Show all commits

23
junos/protocols.nix Normal file
View file

@ -0,0 +1,23 @@
{ 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>
'';
}