From 5018ab847cf19546bafa38a5fc6d05f088063e59 Mon Sep 17 00:00:00 2001 From: catvayor Date: Tue, 30 Apr 2024 16:47:55 +0200 Subject: [PATCH] feat(protocols): Refactor --- junos/protocols.nix | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 junos/protocols.nix diff --git a/junos/protocols.nix b/junos/protocols.nix new file mode 100644 index 0000000..334d6d5 --- /dev/null +++ b/junos/protocols.nix @@ -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: "${intf}") config.protocols.rstp; + in + '' + + + ${concatStringsSep "" rstps} + + + ''; +}