2024-04-30 20:08:07 +02:00
|
|
|
{
|
|
|
|
name,
|
|
|
|
lib,
|
|
|
|
config,
|
|
|
|
...
|
|
|
|
}:
|
|
|
|
with lib;
|
|
|
|
{
|
|
|
|
imports = [
|
|
|
|
./protocols.nix
|
|
|
|
./interfaces.nix
|
|
|
|
./vlans.nix
|
|
|
|
];
|
|
|
|
options = {
|
|
|
|
netconf.xmls.configuration = mkOption {
|
|
|
|
type = types.str;
|
|
|
|
readOnly = true;
|
|
|
|
};
|
|
|
|
netconf.mandatoryInterfaces = mkOption { type = types.listOf types.str; };
|
|
|
|
};
|
|
|
|
config.interfaces =
|
|
|
|
let
|
|
|
|
mkIntf = name: {
|
|
|
|
inherit name;
|
|
|
|
value.enable = mkDefault false;
|
|
|
|
};
|
|
|
|
in
|
|
|
|
listToAttrs (map mkIntf config.netconf.mandatoryInterfaces);
|
|
|
|
config.netconf.xmls.configuration = ''
|
2024-05-22 13:33:28 +02:00
|
|
|
<configuration>
|
|
|
|
${config.netconf.xmls.interfaces}
|
|
|
|
${config.netconf.xmls.protocols}
|
|
|
|
${config.netconf.xmls.vlans}
|
|
|
|
</configuration>
|
|
|
|
'';
|
2024-04-30 20:08:07 +02:00
|
|
|
}
|