frr: add config options for minimalization and advanced networking

Signed-off-by: Markus Theil <theil.markus@gmail.com>
This commit is contained in:
Markus Theil 2023-07-21 15:40:10 +02:00
parent 93c0489bdc
commit 6730140c87

View File

@ -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 = ''