diff options
author | Silvan Mosberger <contact@infinisil.com> | 2020-04-02 20:56:42 +0200 |
---|---|---|
committer | Silvan Mosberger <contact@infinisil.com> | 2020-04-02 21:42:59 +0200 |
commit | 848ed261f527c6af44b664895b4a42ab434f297b (patch) | |
tree | 71fb6ca27d1d2c40add70f774559c301b49c677d | |
parent | f75c11cfdfff3448623250e151cb47df70d4f224 (diff) | |
download | nixpkgs-848ed261f527c6af44b664895b4a42ab434f297b.tar nixpkgs-848ed261f527c6af44b664895b4a42ab434f297b.tar.gz nixpkgs-848ed261f527c6af44b664895b4a42ab434f297b.tar.bz2 nixpkgs-848ed261f527c6af44b664895b4a42ab434f297b.tar.lz nixpkgs-848ed261f527c6af44b664895b4a42ab434f297b.tar.xz nixpkgs-848ed261f527c6af44b664895b4a42ab434f297b.tar.zst nixpkgs-848ed261f527c6af44b664895b4a42ab434f297b.zip |
nfs-utils: Add enablePython argument
If turned off, all binaries that need python are excluded With the argument disabled, this reduces closure size from 219.5M to 160.3M
-rw-r--r-- | pkgs/os-specific/linux/nfs-utils/default.nix | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/pkgs/os-specific/linux/nfs-utils/default.nix b/pkgs/os-specific/linux/nfs-utils/default.nix index 74363be47f4..20dc6a094e7 100644 --- a/pkgs/os-specific/linux/nfs-utils/default.nix +++ b/pkgs/os-specific/linux/nfs-utils/default.nix @@ -1,6 +1,7 @@ { stdenv, fetchurl, fetchpatch, lib, pkgconfig, utillinux, libcap, libtirpc, libevent , sqlite, kerberos, kmod, libuuid, keyutils, lvm2, systemd, coreutils, tcp_wrappers , python3, buildPackages, nixosTests +, enablePython ? true }: let @@ -25,8 +26,7 @@ stdenv.mkDerivation rec { buildInputs = [ libtirpc libcap libevent sqlite lvm2 libuuid keyutils kerberos tcp_wrappers - python3 - ]; + ] ++ lib.optional enablePython python3; enableParallelBuilding = true; @@ -96,6 +96,9 @@ stdenv.mkDerivation rec { -e "s,/sbin/modprobe,${kmod}/bin/modprobe,g" \ -e "s,/usr/sbin,$out/bin,g" \ $out/etc/systemd/system/* + '' + lib.optionalString (!enablePython) '' + # Remove all scripts that require python (currently mountstats and nfsiostat) + grep -l /usr/bin/python $out/bin/* | xargs -I {} rm -v {} ''; # One test fails on mips. |