summary refs log tree commit diff
path: root/pkgs/os-specific/linux/zfs
diff options
context:
space:
mode:
authorSilvan Mosberger <contact@infinisil.com>2020-04-08 12:53:28 +0200
committerGitHub <noreply@github.com>2020-04-08 12:53:28 +0200
commitb293421a69a033c79b9aed0b45d1b8b5edf014d1 (patch)
treebde2992b8095bc471ab06b25d6fe9dbd0b3c99b1 /pkgs/os-specific/linux/zfs
parent0fc7da19b4d2268027d70ee667838a5ce4e3769a (diff)
parent0a43c6e0f9bc13b00df67e74a0182f48d98ec2f6 (diff)
downloadnixpkgs-b293421a69a033c79b9aed0b45d1b8b5edf014d1.tar
nixpkgs-b293421a69a033c79b9aed0b45d1b8b5edf014d1.tar.gz
nixpkgs-b293421a69a033c79b9aed0b45d1b8b5edf014d1.tar.bz2
nixpkgs-b293421a69a033c79b9aed0b45d1b8b5edf014d1.tar.lz
nixpkgs-b293421a69a033c79b9aed0b45d1b8b5edf014d1.tar.xz
nixpkgs-b293421a69a033c79b9aed0b45d1b8b5edf014d1.tar.zst
nixpkgs-b293421a69a033c79b9aed0b45d1b8b5edf014d1.zip
Merge pull request #84129 from Infinisil/removing-python-from-grub
Support removing python from zfs/grub closure
Diffstat (limited to 'pkgs/os-specific/linux/zfs')
-rw-r--r--pkgs/os-specific/linux/zfs/default.nix13
1 files changed, 10 insertions, 3 deletions
diff --git a/pkgs/os-specific/linux/zfs/default.nix b/pkgs/os-specific/linux/zfs/default.nix
index 423b78ede39..2486f82d2ee 100644
--- a/pkgs/os-specific/linux/zfs/default.nix
+++ b/pkgs/os-specific/linux/zfs/default.nix
@@ -12,6 +12,7 @@
 
 # Kernel dependencies
 , kernel ? null
+, enablePython ? true
 }:
 
 with stdenv.lib;
@@ -57,7 +58,12 @@ let
       '' + optionalString buildUser ''
         substituteInPlace ./lib/libzfs/libzfs_mount.c --replace "/bin/umount"             "${utillinux}/bin/umount" \
                                                       --replace "/bin/mount"              "${utillinux}/bin/mount"
-        substituteInPlace ./lib/libshare/nfs.c        --replace "/usr/sbin/exportfs"      "${nfs-utils}/bin/exportfs"
+        substituteInPlace ./lib/libshare/nfs.c        --replace "/usr/sbin/exportfs"      "${
+          # We don't *need* python support, but we set it like this to minimize closure size:
+          # If it's disabled by default, no need to enable it, even if we have python enabled
+          # And if it's enabled by default, only change that if we explicitly disable python to remove python from the closure
+          nfs-utils.override (old: { enablePython = old.enablePython or true && enablePython; })
+        }/bin/exportfs"
         substituteInPlace ./config/user-systemd.m4    --replace "/usr/lib/modules-load.d" "$out/etc/modules-load.d"
         substituteInPlace ./config/zfs-build.m4       --replace "\$sysconfdir/init.d"     "$out/etc/init.d"
         substituteInPlace ./etc/zfs/Makefile.am       --replace "\$(sysconfdir)"          "$out/etc"
@@ -92,7 +98,8 @@ let
       nativeBuildInputs = [ autoreconfHook nukeReferences ]
         ++ optionals buildKernel (kernel.moduleBuildDependencies ++ [ perl ]);
       buildInputs = optionals buildUser [ zlib libuuid attr ]
-        ++ optionals (buildUser) [ openssl python3 ]
+        ++ optional buildUser openssl
+        ++ optional (buildUser && enablePython) python3
         ++ optional stdenv.hostPlatform.isMusl libtirpc;
 
       # for zdb to get the rpath to libgcc_s, needed for pthread_cancel to work
@@ -102,7 +109,7 @@ let
 
       configureFlags = [
         "--with-config=${configFile}"
-        (withFeatureAs buildUser "python" python3.interpreter)
+        (withFeatureAs (buildUser && enablePython) "python" python3.interpreter)
       ] ++ optionals buildUser [
         "--with-dracutdir=$(out)/lib/dracut"
         "--with-udevdir=$(out)/lib/udev"