forked from DGNum/infrastructure
Tom Hubrecht
318f6927c1
The code is copied from netconf-module, `with lib;` have been replaced by inherits
33 lines
681 B
Nix
33 lines
681 B
Nix
{ config, lib, ... }:
|
|
|
|
let
|
|
inherit (lib) concatMapStringsSep mkOption;
|
|
|
|
inherit (lib.types) listOf str;
|
|
in
|
|
|
|
{
|
|
options = {
|
|
protocols.rstp = mkOption {
|
|
type = listOf str;
|
|
description = ''
|
|
List of interfaces on which Rapid Spanning Tree Protocol should be enabled.
|
|
'';
|
|
};
|
|
netconf.xmls.protocols = mkOption {
|
|
type = str;
|
|
visible = false;
|
|
readOnly = true;
|
|
};
|
|
};
|
|
|
|
config.netconf.xmls.protocols = ''
|
|
<protocols>
|
|
<rstp operation="replace">
|
|
${
|
|
concatMapStringsSep "" (intf: "<interface><name>${intf}</name></interface>") config.protocols.rstp
|
|
}
|
|
</rstp>
|
|
</protocols>
|
|
'';
|
|
}
|