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
This commit is contained in:
parent
f75c11cfdf
commit
848ed261f5
@ -1,6 +1,7 @@
|
|||||||
{ stdenv, fetchurl, fetchpatch, lib, pkgconfig, utillinux, libcap, libtirpc, libevent
|
{ stdenv, fetchurl, fetchpatch, lib, pkgconfig, utillinux, libcap, libtirpc, libevent
|
||||||
, sqlite, kerberos, kmod, libuuid, keyutils, lvm2, systemd, coreutils, tcp_wrappers
|
, sqlite, kerberos, kmod, libuuid, keyutils, lvm2, systemd, coreutils, tcp_wrappers
|
||||||
, python3, buildPackages, nixosTests
|
, python3, buildPackages, nixosTests
|
||||||
|
, enablePython ? true
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
@ -25,8 +26,7 @@ stdenv.mkDerivation rec {
|
|||||||
buildInputs = [
|
buildInputs = [
|
||||||
libtirpc libcap libevent sqlite lvm2
|
libtirpc libcap libevent sqlite lvm2
|
||||||
libuuid keyutils kerberos tcp_wrappers
|
libuuid keyutils kerberos tcp_wrappers
|
||||||
python3
|
] ++ lib.optional enablePython python3;
|
||||||
];
|
|
||||||
|
|
||||||
enableParallelBuilding = true;
|
enableParallelBuilding = true;
|
||||||
|
|
||||||
@ -96,6 +96,9 @@ stdenv.mkDerivation rec {
|
|||||||
-e "s,/sbin/modprobe,${kmod}/bin/modprobe,g" \
|
-e "s,/sbin/modprobe,${kmod}/bin/modprobe,g" \
|
||||||
-e "s,/usr/sbin,$out/bin,g" \
|
-e "s,/usr/sbin,$out/bin,g" \
|
||||||
$out/etc/systemd/system/*
|
$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.
|
# One test fails on mips.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user