From 6730140c87d7a049712e0fa150625eba07f0aa39 Mon Sep 17 00:00:00 2001 From: Markus Theil Date: Fri, 21 Jul 2023 15:40:10 +0200 Subject: [PATCH] frr: add config options for minimalization and advanced networking Signed-off-by: Markus Theil --- pkgs/servers/frr/default.nix | 80 ++++++++++++++++++++++++++++++++++-- 1 file changed, 76 insertions(+), 4 deletions(-) diff --git a/pkgs/servers/frr/default.nix b/pkgs/servers/frr/default.nix index 9542e921c5fb..f1b2afc7884b 100644 --- a/pkgs/servers/frr/default.nix +++ b/pkgs/servers/frr/default.nix @@ -30,8 +30,45 @@ , nettools , nixosTests -# options +# general options , snmpSupport ? true +, rpkiSupport ? true +, numMultipath ? 64 +, watchfrrSupport ? true +, cumulusSupport ? false +, datacenterSupport ? true +, rtadvSupport ? true +, irdpSupport ? true +, routeReplacementSupport ? true + +# routing daemon options +, bgpdSupport ? true +, ripdSupport ? true +, ripngdSupport ? true +, ospfdSupport ? true +, ospf6dSupport ? true +, ldpdSupport ? true +, nhrpdSupport ? true +, eigrpdSupport ? true +, babeldSupport ? true +, isisdSupport ? true +, pimdSupport ? true +, pim6dSupport ? true +, sharpdSupport ? true +, fabricdSupport ? true +, vrrpdSupport ? true +, pathdSupport ? true +, bfddSupport ? true +, pbrdSupport ? true +, staticdSupport ? true + +# BGP options +, bgpAnnounce ? true +, bgpBmp ? true +, bgpVnc ? true + +# OSPF options +, ospfApi ? true }: assert snmpSupport -> stdenv.buildPlatform.canExecute stdenv.hostPlatform; @@ -90,15 +127,50 @@ stdenv.mkDerivation rec { "--enable-configfile-mask=0640" "--enable-group=frr" "--enable-logfile-mask=0640" - "--enable-multipath=64" - (lib.strings.enableFeature snmpSupport "snmp") + "--enable-multipath=${toString numMultipath}" "--enable-user=frr" "--enable-vty-group=frrvty" "--localstatedir=/run/frr" "--sbindir=$(out)/libexec/frr" "--sysconfdir=/etc/frr" - "--enable-rpki" "--with-clippy=${clippy-helper}/bin/clippy" + # general options + (lib.strings.enableFeature snmpSupport "snmp") + (lib.strings.enableFeature rpkiSupport "rpki") + (lib.strings.enableFeature watchfrrSupport "watchfrr") + (lib.strings.enableFeature rtadvSupport "rtadv") + (lib.strings.enableFeature irdpSupport "irdp") + (lib.strings.enableFeature routeReplacementSupport "rr-semantics") + # routing protocols + (lib.strings.enableFeature bgpdSupport "bgpd") + (lib.strings.enableFeature ripdSupport "ripd") + (lib.strings.enableFeature ripngdSupport "ripngd") + (lib.strings.enableFeature ospfdSupport "ospfd") + (lib.strings.enableFeature ospf6dSupport "ospf6d") + (lib.strings.enableFeature ldpdSupport "ldpd") + (lib.strings.enableFeature nhrpdSupport "nhrpd") + (lib.strings.enableFeature eigrpdSupport "eigrpd") + (lib.strings.enableFeature babeldSupport "babeld") + (lib.strings.enableFeature isisdSupport "isisd") + (lib.strings.enableFeature pimdSupport "pimd") + (lib.strings.enableFeature pim6dSupport "pim6d") + (lib.strings.enableFeature sharpdSupport "sharpd") + (lib.strings.enableFeature fabricdSupport "fabricd") + (lib.strings.enableFeature vrrpdSupport "vrrpd") + (lib.strings.enableFeature pathdSupport "pathd") + (lib.strings.enableFeature bfddSupport "bfdd") + (lib.strings.enableFeature pbrdSupport "pbrd") + (lib.strings.enableFeature staticdSupport "staticd") + # BGP options + (lib.strings.enableFeature bgpAnnounce "bgp-announce") + (lib.strings.enableFeature bgpBmp "bgp-bmp") + (lib.strings.enableFeature bgpVnc "bgp-vnc") + # OSPF options + (lib.strings.enableFeature ospfApi "ospfapi") + # Cumulus options + (lib.strings.enableFeature cumulusSupport "cumulus") + # Datacenter options + (lib.strings.enableFeature datacenterSupport "datacenter") ]; postPatch = ''