summary refs log tree commit diff
path: root/pkgs/os-specific/linux/util-linux
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2021-10-05 16:13:24 +0000
committerAlyssa Ross <hi@alyssa.is>2021-10-11 15:15:14 +0000
commit5a963f1d97bb2d0bfb90efad806fc7d235720942 (patch)
treee58031e7a90905933f973111fd7fcd206e28c330 /pkgs/os-specific/linux/util-linux
parentacb63e654e3c3a7e9f5b3bc55bb40d7287ffba7f (diff)
downloadnixpkgs-5a963f1d97bb2d0bfb90efad806fc7d235720942.tar
nixpkgs-5a963f1d97bb2d0bfb90efad806fc7d235720942.tar.gz
nixpkgs-5a963f1d97bb2d0bfb90efad806fc7d235720942.tar.bz2
nixpkgs-5a963f1d97bb2d0bfb90efad806fc7d235720942.tar.lz
nixpkgs-5a963f1d97bb2d0bfb90efad806fc7d235720942.tar.xz
nixpkgs-5a963f1d97bb2d0bfb90efad806fc7d235720942.tar.zst
nixpkgs-5a963f1d97bb2d0bfb90efad806fc7d235720942.zip
util-linux: replace "minimal" opt with more outputs
The "minimal" argument just removed some files to reduce package
size.  Now that we have multiple output derivations in Nixpkgs (we
didn't when "minimal" was added), we can just throw more outputs at
this problem and get the same effect, with the advantage that those
files are actually there, available for download without a rebuild, if
they're ever needed.

I've tested that with this change, there's no difference in the
closure size of util-linuxMinimal.bin.

We have to set SYSCONFSTATICDIR to stop $bin/bin/agetty looking in
$out for issue or issue.d.  SYSCONFSTATICDIR is supposed to be for
configuration that comes with a package, but it's currently only used
for finding an issue, and util-linux doesn't come with any issue
files, so I'm not really sure what the point is...
Diffstat (limited to 'pkgs/os-specific/linux/util-linux')
-rw-r--r--pkgs/os-specific/linux/util-linux/default.nix11
1 files changed, 4 insertions, 7 deletions
diff --git a/pkgs/os-specific/linux/util-linux/default.nix b/pkgs/os-specific/linux/util-linux/default.nix
index 294581b0e68..7ab2489f5e8 100644
--- a/pkgs/os-specific/linux/util-linux/default.nix
+++ b/pkgs/os-specific/linux/util-linux/default.nix
@@ -1,7 +1,6 @@
 { lib, stdenv, fetchurl, pkg-config, zlib, shadow, libcap_ng
 , ncurses ? null, pam, systemd ? null
-, minimal ? false
-, nlsSupport ? !minimal
+, nlsSupport ? true
 }:
 
 stdenv.mkDerivation rec {
@@ -17,7 +16,7 @@ stdenv.mkDerivation rec {
     ./rtcwake-search-PATH-for-shutdown.patch
   ];
 
-  outputs = [ "bin" "dev" "out" "man" ];
+  outputs = [ "bin" "dev" "out" "lib" "man" ];
 
   postPatch = ''
     patchShebangs tests/run.sh
@@ -46,12 +45,14 @@ stdenv.mkDerivation rec {
     (lib.withFeature (systemd != null) "systemd")
     (lib.withFeatureAs (systemd != null)
        "systemdsystemunitdir" "${placeholder "bin"}/lib/systemd/system/")
+    "SYSCONFSTATICDIR=${placeholder "lib"}/lib"
   ] ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform)
        "scanf_cv_type_modifier=ms"
   ;
 
   makeFlags = [
     "usrbin_execdir=${placeholder "bin"}/bin"
+    "usrlib_execdir=${placeholder "lib"}/lib"
     "usrsbin_execdir=${placeholder "bin"}/sbin"
   ];
 
@@ -62,10 +63,6 @@ stdenv.mkDerivation rec {
 
   doCheck = false; # "For development purpose only. Don't execute on production system!"
 
-  postInstall = lib.optionalString minimal ''
-    rm -rf $out/share/{doc,bash-completion}
-  '';
-
   enableParallelBuilding = true;
 
   meta = with lib; {