summary refs log tree commit diff
diff options
context:
space:
mode:
authorWilliam A. Kennington III <william@wkennington.com>2014-04-05 13:41:23 -0500
committerWilliam A. Kennington III <william@wkennington.com>2014-04-05 16:01:52 -0500
commit28ab3acb58b0e5a5ffa932c9c6eb19db05a6c334 (patch)
tree73e82a6fd588acd0b85a5fc07dfd2479dfcbcd01
parent4ab58240a9c5cf977767965d978a8f6bb7127f41 (diff)
downloadnixpkgs-28ab3acb58b0e5a5ffa932c9c6eb19db05a6c334.tar
nixpkgs-28ab3acb58b0e5a5ffa932c9c6eb19db05a6c334.tar.gz
nixpkgs-28ab3acb58b0e5a5ffa932c9c6eb19db05a6c334.tar.bz2
nixpkgs-28ab3acb58b0e5a5ffa932c9c6eb19db05a6c334.tar.lz
nixpkgs-28ab3acb58b0e5a5ffa932c9c6eb19db05a6c334.tar.xz
nixpkgs-28ab3acb58b0e5a5ffa932c9c6eb19db05a6c334.tar.zst
nixpkgs-28ab3acb58b0e5a5ffa932c9c6eb19db05a6c334.zip
su: Make the su package a provider of only the su binary
Additionally, provide su with the base system and remove su from the
util-linux package as it is now provided by shadow.
-rw-r--r--nixos/modules/config/system-path.nix1
-rw-r--r--pkgs/os-specific/linux/shadow/default.nix8
-rw-r--r--pkgs/os-specific/linux/util-linux/default.nix4
-rw-r--r--pkgs/top-level/all-packages.nix2
4 files changed, 13 insertions, 2 deletions
diff --git a/nixos/modules/config/system-path.nix b/nixos/modules/config/system-path.nix
index 2f61947c3bc..1913e17f929 100644
--- a/nixos/modules/config/system-path.nix
+++ b/nixos/modules/config/system-path.nix
@@ -46,6 +46,7 @@ let
       pkgs.rsync
       pkgs.strace
       pkgs.sysvtools
+      pkgs.su
       pkgs.time
       pkgs.usbutils
       pkgs.utillinux
diff --git a/pkgs/os-specific/linux/shadow/default.nix b/pkgs/os-specific/linux/shadow/default.nix
index 1055fccd8aa..9d024ae3109 100644
--- a/pkgs/os-specific/linux/shadow/default.nix
+++ b/pkgs/os-specific/linux/shadow/default.nix
@@ -26,6 +26,8 @@ stdenv.mkDerivation rec {
 
   patches = [ ./keep-path.patch dots_in_usernames ];
 
+  outputs = [ "out" "su" ];
+
   # Assume System V `setpgrp (void)', which is the default on GNU variants
   # (`AC_FUNC_SETPGRP' is not cross-compilation capable.)
   preConfigure = "export ac_cv_func_setpgrp_void=yes";
@@ -35,10 +37,14 @@ stdenv.mkDerivation rec {
       substituteInPlace lib/nscd.c --replace /usr/sbin/nscd ${glibc}/sbin/nscd
     '';
 
-  # Don't install ‘groups’, since coreutils already provides it.
   postInstall =
     ''
+      # Don't install ‘groups’, since coreutils already provides it.
       rm $out/bin/groups $out/share/man/man1/groups.*
+
+      # Move the su binary into the su package
+      mkdir -p $su/bin
+      mv $out/bin/su $su/bin
     '';
 
   meta = {
diff --git a/pkgs/os-specific/linux/util-linux/default.nix b/pkgs/os-specific/linux/util-linux/default.nix
index 3f676d37dd8..ec43ee1e64f 100644
--- a/pkgs/os-specific/linux/util-linux/default.nix
+++ b/pkgs/os-specific/linux/util-linux/default.nix
@@ -36,6 +36,10 @@ stdenv.mkDerivation rec {
     ++ stdenv.lib.optional (ncurses != null) ncurses
     ++ stdenv.lib.optional (perl != null) perl;
 
+  postInstall = ''
+    rm $out/bin/su # su should be supplied by the su package (shadow)
+  '';
+
   enableParallelBuilding = true;
 
   meta = {
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 1daa2eba8a5..da971258d50 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -1995,7 +1995,7 @@ let
 
   stunnel = callPackage ../tools/networking/stunnel { };
 
-  su = shadow;
+  su = shadow.su;
 
   surfraw = callPackage ../tools/networking/surfraw { };