34 # FRR's configure.ac gets SNMP options by executing net-snmp-config on the build host
35 # This leads to compilation errors when cross compiling.
36 # E.g. net-snmp-config for x86_64 does not return the ARM64 paths.
38 # SNMP_LIBS="`${NETSNMP_CONFIG} --agent-libs`"
39 # SNMP_CFLAGS="`${NETSNMP_CONFIG} --base-cflags`"
40 , snmpSupport ? stdenv.buildPlatform.canExecute stdenv.hostPlatform
42 # other general options besides snmp support
45 , watchfrrSupport ? true
46 , cumulusSupport ? false
47 , datacenterSupport ? true
50 , routeReplacementSupport ? true
53 # routing daemon options
56 , ripngdSupport ? true
58 , ospf6dSupport ? true
61 , eigrpdSupport ? true
62 , babeldSupport ? true
66 , sharpdSupport ? true
67 , fabricdSupport ? true
72 , staticdSupport ? true
83 lib.warnIf (!(stdenv.buildPlatform.canExecute stdenv.hostPlatform))
84 "cannot enable SNMP support due to cross-compilation issues with net-snmp-config"
86 stdenv.mkDerivation rec {
90 src = fetchFromGitHub {
93 rev = "${pname}-${version}";
94 hash = "sha256-bY5SSF/fmKQc8ECPik0v/ZlUiFsbZhwG2C5pbmoMzwQ=";
120 ] ++ lib.optionals stdenv.isLinux [
122 ] ++ lib.optionals snmpSupport [
124 ] ++ lib.optionals (lib.meta.availableOn stdenv.hostPlatform elfutils) [
128 # otherwise in cross-compilation: "configure: error: no working python version found"
130 buildPackages.python3
133 # cross-compiling: clippy is compiled with the build host toolchain, split it out to ease
134 # navigation in dependency hell
135 clippy-helper = buildPackages.callPackage ./clippy-helper.nix { frrVersion = version; frrSource = src; };
138 "--disable-silent-rules"
139 "--disable-exampledir"
140 "--enable-configfile-mask=0640"
142 "--enable-logfile-mask=0640"
143 "--enable-multipath=${toString numMultipath}"
145 "--enable-vty-group=frrvty"
146 "--localstatedir=/run/frr"
147 "--sbindir=$(out)/libexec/frr"
148 "--sysconfdir=/etc/frr"
149 "--with-clippy=${clippy-helper}/bin/clippy"
151 (lib.strings.enableFeature snmpSupport "snmp")
152 (lib.strings.enableFeature rpkiSupport "rpki")
153 (lib.strings.enableFeature watchfrrSupport "watchfrr")
154 (lib.strings.enableFeature rtadvSupport "rtadv")
155 (lib.strings.enableFeature irdpSupport "irdp")
156 (lib.strings.enableFeature routeReplacementSupport "rr-semantics")
157 (lib.strings.enableFeature mgmtdSupport "mgmtd")
160 (lib.strings.enableFeature bgpdSupport "bgpd")
161 (lib.strings.enableFeature ripdSupport "ripd")
162 (lib.strings.enableFeature ripngdSupport "ripngd")
163 (lib.strings.enableFeature ospfdSupport "ospfd")
164 (lib.strings.enableFeature ospf6dSupport "ospf6d")
165 (lib.strings.enableFeature ldpdSupport "ldpd")
166 (lib.strings.enableFeature nhrpdSupport "nhrpd")
167 (lib.strings.enableFeature eigrpdSupport "eigrpd")
168 (lib.strings.enableFeature babeldSupport "babeld")
169 (lib.strings.enableFeature isisdSupport "isisd")
170 (lib.strings.enableFeature pimdSupport "pimd")
171 (lib.strings.enableFeature pim6dSupport "pim6d")
172 (lib.strings.enableFeature sharpdSupport "sharpd")
173 (lib.strings.enableFeature fabricdSupport "fabricd")
174 (lib.strings.enableFeature vrrpdSupport "vrrpd")
175 (lib.strings.enableFeature pathdSupport "pathd")
176 (lib.strings.enableFeature bfddSupport "bfdd")
177 (lib.strings.enableFeature pbrdSupport "pbrd")
178 (lib.strings.enableFeature staticdSupport "staticd")
180 (lib.strings.enableFeature bgpAnnounce "bgp-announce")
181 (lib.strings.enableFeature bgpBmp "bgp-bmp")
182 (lib.strings.enableFeature bgpVnc "bgp-vnc")
184 (lib.strings.enableFeature ospfApi "ospfapi")
186 (lib.strings.enableFeature cumulusSupport "cumulus")
188 (lib.strings.enableFeature datacenterSupport "datacenter")
192 substituteInPlace tools/frr-reload \
193 --replace /usr/lib/frr/ $out/libexec/frr/
198 nativeCheckInputs = [
203 enableParallelBuilding = true;
206 homepage = "https://frrouting.org/";
207 description = "FRR BGP/OSPF/ISIS/RIP/RIPNG routing daemon suite";
209 FRRouting (FRR) is a free and open source Internet routing protocol suite
210 for Linux and Unix platforms. It implements BGP, OSPF, RIP, IS-IS, PIM,
211 LDP, BFD, Babel, PBR, OpenFabric and VRRP, with alpha support for EIGRP
214 FRR’s seamless integration with native Linux/Unix IP networking stacks
215 makes it a general purpose routing stack applicable to a wide variety of
216 use cases including connecting hosts/VMs/containers to the network,
217 advertising network services, LAN switching and routing, Internet access
218 routers, and Internet peering.
220 FRR has its roots in the Quagga project. In fact, it was started by many
221 long-time Quagga developers who combined their efforts to improve on
222 Quagga’s well-established foundation in order to create the best routing
223 protocol stack available. We invite you to participate in the FRRouting
224 community and help shape the future of networking.
226 Join the ranks of network architects using FRR for ISPs, SaaS
227 infrastructure, web 2.0 businesses, hyperscale services, and Fortune 500
230 license = with licenses; [ gpl2Plus lgpl21Plus ];
231 maintainers = with maintainers; [ woffs thillux ];
232 # adapt to platforms stated in http://docs.frrouting.org/en/latest/overview.html#supported-platforms
233 platforms = (platforms.linux ++ platforms.freebsd ++ platforms.netbsd ++ platforms.openbsd);
236 passthru.tests = { inherit (nixosTests) frr; };