unixtools: cleanup

This commit is contained in:
Matthew Bauer 2018-03-26 22:37:49 -05:00
parent 35d6688a1b
commit 4a9fddc598
5 changed files with 55 additions and 19 deletions

View file

@ -1,4 +1,4 @@
{ stdenv, lib, fetchurl, flex, bison, linuxHeaders, libtirpc, utillinux, nfs-utils, e2fsprogs
{ stdenv, lib, fetchurl, flex, bison, linuxHeaders, libtirpc, mount, umount, modprobe, nfs-utils, e2fsprogs
, libxml2, kerberos, kmod, openldap, sssd, cyrus_sasl, openssl }:
let
@ -17,10 +17,10 @@ in stdenv.mkDerivation {
export sssldir="${sssd}/lib/sssd/modules"
export HAVE_SSS_AUTOFS=1
export MOUNT=${utillinux}/bin/mount
export MOUNT=${mount}/bin/mount
export MOUNT_NFS=${nfs-utils}/bin/mount.nfs
export UMOUNT=${utillinux}/bin/umount
export MODPROBE=${utillinux}/bin/modprobe
export UMOUNT=${umount}/bin/umount
export MODPROBE=${modprobe}/bin/modprobe
export E2FSCK=${e2fsprogs}/bin/fsck.ext2
export E3FSCK=${e2fsprogs}/bin/fsck.ext3
export E4FSCK=${e2fsprogs}/bin/fsck.ext4

View file

@ -1,4 +1,5 @@
{ stdenv, fetchurl, pkgconfig, systemd, utillinux, coreutils, nettools, man
{ stdenv, fetchurl, pkgconfig, systemd, utillinux, coreutils, wall, hostname, man
, utillinux
, enableCgiScripts ? true, gd
}:
@ -46,8 +47,8 @@ stdenv.mkDerivation rec {
postInstall = ''
for file in "$out"/etc/apcupsd/*; do
sed -i -e 's|^WALL=.*|WALL="${utillinux}/bin/wall"|g' \
-e 's|^HOSTNAME=.*|HOSTNAME=`${nettools}/bin/hostname`|g' \
sed -i -e 's|^WALL=.*|WALL="${wall}/bin/wall"|g' \
-e 's|^HOSTNAME=.*|HOSTNAME=`${hostname}/bin/hostname`|g' \
"$file"
done
'';

View file

@ -4608,11 +4608,7 @@ with pkgs;
v8 = v8_static;
};
rsnapshot = callPackage ../tools/backup/rsnapshot {
# For the `logger' command, we can use either `utillinux' or
# GNU Inetutils. The latter is more portable.
logger = if stdenv.isLinux then utillinux else inetutils;
};
rsnapshot = callPackage ../tools/backup/rsnapshot { };
rlwrap = callPackage ../tools/misc/rlwrap { };
@ -7659,7 +7655,6 @@ with pkgs;
inherit (perlPackages) perl
ExporterLite FileWhich GetoptTabular RegexpCommon TermReadKey;
inherit (llvmPackages_4) llvm clang-unwrapped;
utillinux = if stdenv.isLinux then utillinuxMinimal else null;
};
cscope = callPackage ../development/tools/misc/cscope { };
@ -13091,7 +13086,7 @@ with pkgs;
})
else if stdenv.isLinux
then utillinuxMinimal
else null;
else libossp_uuid;
light = callPackage ../os-specific/linux/light { };
@ -13099,8 +13094,6 @@ with pkgs;
ebtables = callPackage ../os-specific/linux/ebtables { };
eject = utillinux;
facetimehd-firmware = callPackage ../os-specific/linux/firmware/facetimehd-firmware { };
fatrace = callPackage ../os-specific/linux/fatrace { };
@ -14017,7 +14010,7 @@ with pkgs;
ncurses = null;
perl = null;
systemd = null;
}) else throw "utillinux is unsupported on non-Linux";
}) else utillinux;
v4l_utils = qt5.callPackage ../os-specific/linux/v4l-utils { };
@ -21142,5 +21135,5 @@ with pkgs;
# Unix tools
unixtools = recurseIntoAttrs (callPackages ./unix-tools.nix { });
inherit (unixtools) hexdump ps sysctl;
inherit (unixtools) hexdump ps logger eject modprobe umount mount wall hostname more;
}

View file

@ -7328,7 +7328,7 @@ let self = _self // overrides; _self = with self; {
url = "mirror://cpan/authors/id/J/JP/JPIERCE/IO-Pager-${version}.tgz";
sha256 = "0ksldcw0hydfy9k70i6q6fm1wgbc54kx0lbwlkrszsbd7q72dlfg";
};
propagatedBuildInputs = [pkgs.utillinux.bin]; # `more` used in tests
propagatedBuildInputs = [pkgs.more]; # `more` used in tests
};
IOPrompt = buildPerlPackage {

View file

@ -1,5 +1,15 @@
{ pkgs, buildEnv, runCommand, hostPlatform }:
# These are some unix tools that are commonly included in the /usr/bin
# and /usr/sbin directory under more normal distributions. Along with
# coreutils, these are commonly assumed to be available by build
# systems, but we can't assume they are available. In Nix, we list
# each program by name directly through this unixtools attribute.
# You should always try to use single binaries when available. For
# instance, if your program needs to use "ps", just list it as a build
# input, not "procps" which requires Linux.
let
singleBinary = cmd: providers:
@ -17,10 +27,22 @@ let
else throw "${hostPlatform.parsed.kernel.name} does not have ${cmd}";
in rec {
# more is unavailable in darwin
# just use less
more_compat = runCommand "more" {} ''
mkdir -p $out/bin
ln -s ${pkgs.less}/bin/less $out/bin/more
'';
# singular binaries
arp = singleBinary "arp" {
linux = pkgs.nettools;
darwin = pkgs.darwin.network_cmds;
};
eject = singleBinary "eject" {
linux = pkgs.utillinux;
};
getopt = singleBinary "getopt" {
linux = pkgs.utillinux;
darwin = pkgs.darwin.shell_cmds;
@ -37,6 +59,19 @@ in rec {
linux = pkgs.nettools;
darwin = pkgs.darwin.network_cmds;
};
logger = singleBinary "logger" {
linux = pkgs.utillinux;
};
modprobe = singleBinary "modprobe" {
linux = pkgs.utillinux;
};
more = singleBinary "more" {
linux = pkgs.utillinux;
darwin = pkgs.more_compat;
};
mount = singleBinary "mount" {
linux = pkgs.utillinux;
};
netstat = singleBinary "netstat" {
linux = pkgs.nettools;
darwin = pkgs.darwin.network_cmds;
@ -61,16 +96,23 @@ in rec {
linux = pkgs.procps;
darwin = pkgs.darwin.system_cmds;
};
umount = singleBinary "umount" {
linux = pkgs.utillinux;
};
whereis = singleBinary "whereis" {
linux = pkgs.utillinux;
darwin = pkgs.darwin.shell_cmds;
};
wall = singleBinary "wall" {
linux = pkgs.utillinux;
};
write = singleBinary "write" {
linux = pkgs.utillinux;
darwin = pkgs.darwin.basic_cmds;
};
# Compatibility derivations
# Provided for old usage of these commands.
procps = buildEnv {
name = "procps-compat";