summary refs log tree commit diff
path: root/pkgs/os-specific/linux/util-linux
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2016-09-05 12:13:31 +0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2016-09-05 13:45:59 +0200
commit8295089e6a08798f9cd733ee76e82d939d09faab (patch)
treeff928705d256860309503c0e718b690a50c043f2 /pkgs/os-specific/linux/util-linux
parent2583c70e9158c982e141e8b3a92861091b80dd14 (diff)
downloadnixpkgs-8295089e6a08798f9cd733ee76e82d939d09faab.tar
nixpkgs-8295089e6a08798f9cd733ee76e82d939d09faab.tar.gz
nixpkgs-8295089e6a08798f9cd733ee76e82d939d09faab.tar.bz2
nixpkgs-8295089e6a08798f9cd733ee76e82d939d09faab.tar.lz
nixpkgs-8295089e6a08798f9cd733ee76e82d939d09faab.tar.xz
nixpkgs-8295089e6a08798f9cd733ee76e82d939d09faab.tar.zst
nixpkgs-8295089e6a08798f9cd733ee76e82d939d09faab.zip
utillinuxMinimal: Make more minimal
This removes locales, bash completion and crap like that. This cuts
6.5 MiB from the NixOS system closure (which unfortunately contains
two copies of util-linux, because of the need to break a dependency
cycle with systemd).
Diffstat (limited to 'pkgs/os-specific/linux/util-linux')
-rw-r--r--pkgs/os-specific/linux/util-linux/default.nix16
1 files changed, 9 insertions, 7 deletions
diff --git a/pkgs/os-specific/linux/util-linux/default.nix b/pkgs/os-specific/linux/util-linux/default.nix
index 4d4a22fc720..003dd792966 100644
--- a/pkgs/os-specific/linux/util-linux/default.nix
+++ b/pkgs/os-specific/linux/util-linux/default.nix
@@ -1,9 +1,9 @@
-{ stdenv, fetchurl, pkgconfig, zlib, ncurses ? null, perl ? null, pam, systemd }:
+{ lib, stdenv, fetchurl, pkgconfig, zlib, ncurses ? null, perl ? null, pam, systemd, minimal ? false }:
 
 stdenv.mkDerivation rec {
   name = "util-linux-${version}";
-  version = stdenv.lib.concatStringsSep "." ([ majorVersion ]
-    ++ stdenv.lib.optional (patchVersion != "") patchVersion);
+  version = lib.concatStringsSep "." ([ majorVersion ]
+    ++ lib.optional (patchVersion != "") patchVersion);
   majorVersion = "2.28";
   patchVersion = "1";
 
@@ -56,17 +56,19 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ pkgconfig ];
   buildInputs =
     [ zlib pam ]
-    ++ stdenv.lib.optional (ncurses != null) ncurses
-    ++ stdenv.lib.optional (systemd != null) [ systemd pkgconfig ]
-    ++ stdenv.lib.optional (perl != null) perl;
+    ++ lib.optional (ncurses != null) ncurses
+    ++ lib.optional (systemd != null) [ systemd pkgconfig ]
+    ++ lib.optional (perl != null) perl;
 
   postInstall = ''
     rm "$bin/bin/su" # su should be supplied by the su package (shadow)
+  '' + lib.optionalString minimal ''
+    rm -rf $out/share/{locale,doc,bash-completion}
   '';
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = https://www.kernel.org/pub/linux/utils/util-linux/;
     description = "A set of system utilities for Linux";
     license = licenses.gpl2; # also contains parts under more permissive licenses