diff options
author | Alyssa Ross <hi@alyssa.is> | 2021-10-05 16:13:24 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2021-10-11 15:15:14 +0000 |
commit | 5a963f1d97bb2d0bfb90efad806fc7d235720942 (patch) | |
tree | e58031e7a90905933f973111fd7fcd206e28c330 | |
parent | acb63e654e3c3a7e9f5b3bc55bb40d7287ffba7f (diff) |
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...
-rw-r--r-- | pkgs/os-specific/linux/util-linux/default.nix | 11 | ||||
-rw-r--r-- | pkgs/top-level/all-packages.nix | 2 |
2 files changed, 5 insertions, 8 deletions
diff --git a/pkgs/os-specific/linux/util-linux/default.nix b/pkgs/os-specific/linux/util-linux/default.nix index 294581b0e6857..7ab2489f5e8ae 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; { diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 1200b0954a08d..805b76f4261d9 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -22416,7 +22416,7 @@ with pkgs; util-linuxCurses = util-linux; util-linuxMinimal = if stdenv.isLinux then appendToName "minimal" (util-linux.override { - minimal = true; + nlsSupport = false; ncurses = null; systemd = null; }) else util-linux; |