1 { lib, stdenv, fetchurl
2 , autoreconfHook, pkg-config, pruneLibtoolFiles, flex, bison
3 , libmnl, libnetfilter_conntrack, libnfnetlink, libnftnl, libpcap
4 , nftablesCompat ? true
8 stdenv.mkDerivation rec {
13 url = "https://www.netfilter.org/projects/${pname}/files/${pname}-${version}.tar.xz";
14 sha256 = "XMJVwYk1bjF9BwdVzpNx62Oht4PDRJj7jDAmTzzFnJw=";
17 outputs = [ "out" "dev" "man" ];
20 autoreconfHook pkg-config pruneLibtoolFiles flex bison
23 buildInputs = [ libmnl libnetfilter_conntrack libnfnetlink libnftnl libpcap ];
26 "--enable-bpf-compiler"
31 ] ++ lib.optional (!nftablesCompat) "--disable-nftables";
33 enableParallelBuilding = true;
35 postInstall = lib.optionalString nftablesCompat ''
36 rm $out/sbin/{iptables,iptables-restore,iptables-save,ip6tables,ip6tables-restore,ip6tables-save}
37 ln -sv xtables-nft-multi $out/bin/iptables
38 ln -sv xtables-nft-multi $out/bin/iptables-restore
39 ln -sv xtables-nft-multi $out/bin/iptables-save
40 ln -sv xtables-nft-multi $out/bin/ip6tables
41 ln -sv xtables-nft-multi $out/bin/ip6tables-restore
42 ln -sv xtables-nft-multi $out/bin/ip6tables-save
46 updateScript = gitUpdater {
47 url = "https://git.netfilter.org/iptables";
53 description = "Program to configure the Linux IP packet filtering ruleset";
54 homepage = "https://www.netfilter.org/projects/iptables/index.html";
55 platforms = platforms.linux;
56 maintainers = with maintainers; [ fpletz ];
57 license = licenses.gpl2Plus;
58 downloadPage = "https://www.netfilter.org/projects/iptables/files/";