git.iko.soy/typeable/nixpkgs
on master help sign in
python310Packages.nftables: init from pkgs.nftables, reduce with lib; usage over enitre file
commitd9da7087c03e906ed5cc720a57f18de5329f4007 authorSandro Jäckel <sandro.jaeckel@gmail.com> dateSat 30 Apr 2022, 02:04 (5 years ago) parent9b310a7
2 files changed+12−9
pkgs/os-specific/linux/nftables/default.nix+7−9 pkgs/top-level/python-packages.nix+5
pkgs/os-specific/linux/nftables/default.nix+7−9
@@ -8,8 +8,6 @@
88, withXtables ? true , iptables
99}:
1010
11−with lib;
12−
1311stdenv.mkDerivation rec {
1412 version = "1.0.2";
1513 pname = "nftables";
@@ -28,8 +26,8 @@ stdenv.mkDerivation rec {
2826 buildInputs = [
2927 libmnl libnftnl libpcap
3028 gmp jansson libedit
31− ] ++ optional withXtables iptables
32− ++ optional withPython python3;
29+ ] ++ lib.optional withXtables iptables
30+ ++ lib.optional withPython python3;
3331
3432 preConfigure = ''
3533 substituteInPlace ./configure --replace /usr/bin/file ${file}/bin/file
@@ -46,12 +44,12 @@ stdenv.mkDerivation rec {
4644 configureFlags = [
4745 "--with-json"
4846 "--with-cli=editline"
49− ] ++ optional (!withDebugSymbols) "--disable-debug"
50− ++ optional (!withPython) "--disable-python"
51− ++ optional withPython "--enable-python"
52− ++ optional withXtables "--with-xtables";
47+ ] ++ lib.optional (!withDebugSymbols) "--disable-debug"
48+ ++ lib.optional (!withPython) "--disable-python"
49+ ++ lib.optional withPython "--enable-python"
50+ ++ lib.optional withXtables "--with-xtables";
5351
54− meta = {
52+ meta = with lib; {
5553 description = "The project that aims to replace the existing {ip,ip6,arp,eb}tables framework";
5654 homepage = "https://netfilter.org/projects/nftables/";
5755 license = licenses.gpl2Only;
pkgs/top-level/python-packages.nix+5
@@ -5595,6 +5595,11 @@ in {
55955595
55965596 nextcord = callPackage ../development/python-modules/nextcord { };
55975597
5598+ nftables = toPythonModule (pkgs.nftables.override {
5599+ python3 = python;
5600+ withPython = true;
5601+ });
5602+
55985603 nghttp2 = (toPythonModule (pkgs.nghttp2.override {
55995604 inherit (self) python cython setuptools;
56005605 inherit (pkgs) ncurses;