summary refs log tree commit diff
path: root/pkgs/os-specific/linux/util-linux/default.nix
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2021-10-05 17:06:23 +0000
committerAlyssa Ross <hi@alyssa.is>2021-10-11 15:15:14 +0000
commitacb63e654e3c3a7e9f5b3bc55bb40d7287ffba7f (patch)
treeae60d3b5f10b8b1ea023ce43385142def1c39e90 /pkgs/os-specific/linux/util-linux/default.nix
parent93aac5dac08d4d0bcf03ffce0c4995dfb65b15fc (diff)
downloadnixpkgs-acb63e654e3c3a7e9f5b3bc55bb40d7287ffba7f.tar
nixpkgs-acb63e654e3c3a7e9f5b3bc55bb40d7287ffba7f.tar.gz
nixpkgs-acb63e654e3c3a7e9f5b3bc55bb40d7287ffba7f.tar.bz2
nixpkgs-acb63e654e3c3a7e9f5b3bc55bb40d7287ffba7f.tar.lz
nixpkgs-acb63e654e3c3a7e9f5b3bc55bb40d7287ffba7f.tar.xz
nixpkgs-acb63e654e3c3a7e9f5b3bc55bb40d7287ffba7f.tar.zst
nixpkgs-acb63e654e3c3a7e9f5b3bc55bb40d7287ffba7f.zip
util-linux: disable locales properly
Removing the locales after they've been built and installed is a big
hack when util-linux gives us an option to disable them directly.
This way, the code in util-linux that deals with locales can be
disabled as well, leading to a (very small) size reduction.
Diffstat (limited to 'pkgs/os-specific/linux/util-linux/default.nix')
-rw-r--r--pkgs/os-specific/linux/util-linux/default.nix8
1 files changed, 6 insertions, 2 deletions
diff --git a/pkgs/os-specific/linux/util-linux/default.nix b/pkgs/os-specific/linux/util-linux/default.nix
index 089788aa8be..294581b0e68 100644
--- a/pkgs/os-specific/linux/util-linux/default.nix
+++ b/pkgs/os-specific/linux/util-linux/default.nix
@@ -1,5 +1,8 @@
 { lib, stdenv, fetchurl, pkg-config, zlib, shadow, libcap_ng
-, ncurses ? null, pam, systemd ? null, minimal ? false }:
+, ncurses ? null, pam, systemd ? null
+, minimal ? false
+, nlsSupport ? !minimal
+}:
 
 stdenv.mkDerivation rec {
   pname = "util-linux";
@@ -38,6 +41,7 @@ stdenv.mkDerivation rec {
     "--enable-fs-paths-default=/run/wrappers/bin:/run/current-system/sw/bin:/sbin"
     "--disable-makeinstall-setuid" "--disable-makeinstall-chown"
     "--disable-su" # provided by shadow
+    (lib.enableFeature nlsSupport "nls")
     (lib.withFeature (ncurses != null) "ncursesw")
     (lib.withFeature (systemd != null) "systemd")
     (lib.withFeatureAs (systemd != null)
@@ -59,7 +63,7 @@ stdenv.mkDerivation rec {
   doCheck = false; # "For development purpose only. Don't execute on production system!"
 
   postInstall = lib.optionalString minimal ''
-    rm -rf $out/share/{locale,doc,bash-completion}
+    rm -rf $out/share/{doc,bash-completion}
   '';
 
   enableParallelBuilding = true;