28 lines
651 B
Nix
28 lines
651 B
Nix
{ lib, config, ... }:
|
|
with lib;
|
|
{
|
|
options = {
|
|
protocols.rstp = mkOption {
|
|
type = types.listOf types.str;
|
|
description = ''
|
|
List of interfaces on which Rapid Spanning Tree Protocol should be enabled.
|
|
'';
|
|
};
|
|
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>
|
|
'';
|
|
}
|