From 3b7ea8a7b97cb1ecd20612363d1412a3a6abe431 Mon Sep 17 00:00:00 2001 From: Will Dietz Date: Sun, 5 May 2019 22:37:28 -0500 Subject: [PATCH] utillinux: placeholder, touchup how su is disabled --- pkgs/os-specific/linux/util-linux/default.nix | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/pkgs/os-specific/linux/util-linux/default.nix b/pkgs/os-specific/linux/util-linux/default.nix index 3e94ba5c1ea2..73604769d1e6 100644 --- a/pkgs/os-specific/linux/util-linux/default.nix +++ b/pkgs/os-specific/linux/util-linux/default.nix @@ -41,15 +41,19 @@ in stdenv.mkDerivation rec { "--disable-use-tty-group" "--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.withFeature (ncurses != null) "ncursesw") (lib.withFeature (systemd != null) "systemd") (lib.withFeatureAs (systemd != null) - "systemdsystemunitdir" "$(bin)/lib/systemd/system/") + "systemdsystemunitdir" "${placeholder "bin"}/lib/systemd/system/") ] ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) "scanf_cv_type_modifier=ms" ; - makeFlags = "usrbin_execdir=$(bin)/bin usrsbin_execdir=$(bin)/sbin"; + makeFlags = [ + "usrbin_execdir=${placeholder "bin"}/bin" + "usrsbin_execdir=${placeholder "bin"}/sbin" + ]; nativeBuildInputs = [ pkgconfig ]; buildInputs = @@ -58,9 +62,7 @@ in stdenv.mkDerivation rec { doCheck = false; # "For development purpose only. Don't execute on production system!" - postInstall = '' - rm "$bin/bin/su" # su should be supplied by the su package (shadow) - '' + lib.optionalString minimal '' + postInstall = lib.optionalString minimal '' rm -rf $out/share/{locale,doc,bash-completion} '';