From d9da7087c03e906ed5cc720a57f18de5329f4007 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Sat, 30 Apr 2022 02:04:02 +0200 Subject: [PATCH] python310Packages.nftables: init from pkgs.nftables, reduce with lib; usage over enitre file --- pkgs/os-specific/linux/nftables/default.nix | 16 +++++++--------- pkgs/top-level/python-packages.nix | 5 +++++ 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/pkgs/os-specific/linux/nftables/default.nix b/pkgs/os-specific/linux/nftables/default.nix index 8485a868d8a5..051ca1963051 100644 --- a/pkgs/os-specific/linux/nftables/default.nix +++ b/pkgs/os-specific/linux/nftables/default.nix @@ -8,8 +8,6 @@ , withXtables ? true , iptables }: -with lib; - stdenv.mkDerivation rec { version = "1.0.2"; pname = "nftables"; @@ -28,8 +26,8 @@ stdenv.mkDerivation rec { buildInputs = [ libmnl libnftnl libpcap gmp jansson libedit - ] ++ optional withXtables iptables - ++ optional withPython python3; + ] ++ lib.optional withXtables iptables + ++ lib.optional withPython python3; preConfigure = '' substituteInPlace ./configure --replace /usr/bin/file ${file}/bin/file @@ -46,12 +44,12 @@ stdenv.mkDerivation rec { configureFlags = [ "--with-json" "--with-cli=editline" - ] ++ optional (!withDebugSymbols) "--disable-debug" - ++ optional (!withPython) "--disable-python" - ++ optional withPython "--enable-python" - ++ optional withXtables "--with-xtables"; + ] ++ lib.optional (!withDebugSymbols) "--disable-debug" + ++ lib.optional (!withPython) "--disable-python" + ++ lib.optional withPython "--enable-python" + ++ lib.optional withXtables "--with-xtables"; - meta = { + meta = with lib; { description = "The project that aims to replace the existing {ip,ip6,arp,eb}tables framework"; homepage = "https://netfilter.org/projects/nftables/"; license = licenses.gpl2Only; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 3616171dfdfd..e4236c1d2d2e 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -5595,6 +5595,11 @@ in { nextcord = callPackage ../development/python-modules/nextcord { }; + nftables = toPythonModule (pkgs.nftables.override { + python3 = python; + withPython = true; + }); + nghttp2 = (toPythonModule (pkgs.nghttp2.override { inherit (self) python cython setuptools; inherit (pkgs) ncurses;