unixtools: cleanup
This commit is contained in:
parent
35d6688a1b
commit
4a9fddc598
@ -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 }:
|
, libxml2, kerberos, kmod, openldap, sssd, cyrus_sasl, openssl }:
|
||||||
|
|
||||||
let
|
let
|
||||||
@ -17,10 +17,10 @@ in stdenv.mkDerivation {
|
|||||||
export sssldir="${sssd}/lib/sssd/modules"
|
export sssldir="${sssd}/lib/sssd/modules"
|
||||||
export HAVE_SSS_AUTOFS=1
|
export HAVE_SSS_AUTOFS=1
|
||||||
|
|
||||||
export MOUNT=${utillinux}/bin/mount
|
export MOUNT=${mount}/bin/mount
|
||||||
export MOUNT_NFS=${nfs-utils}/bin/mount.nfs
|
export MOUNT_NFS=${nfs-utils}/bin/mount.nfs
|
||||||
export UMOUNT=${utillinux}/bin/umount
|
export UMOUNT=${umount}/bin/umount
|
||||||
export MODPROBE=${utillinux}/bin/modprobe
|
export MODPROBE=${modprobe}/bin/modprobe
|
||||||
export E2FSCK=${e2fsprogs}/bin/fsck.ext2
|
export E2FSCK=${e2fsprogs}/bin/fsck.ext2
|
||||||
export E3FSCK=${e2fsprogs}/bin/fsck.ext3
|
export E3FSCK=${e2fsprogs}/bin/fsck.ext3
|
||||||
export E4FSCK=${e2fsprogs}/bin/fsck.ext4
|
export E4FSCK=${e2fsprogs}/bin/fsck.ext4
|
||||||
|
@ -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
|
, enableCgiScripts ? true, gd
|
||||||
}:
|
}:
|
||||||
|
|
||||||
@ -46,8 +47,8 @@ stdenv.mkDerivation rec {
|
|||||||
|
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
for file in "$out"/etc/apcupsd/*; do
|
for file in "$out"/etc/apcupsd/*; do
|
||||||
sed -i -e 's|^WALL=.*|WALL="${utillinux}/bin/wall"|g' \
|
sed -i -e 's|^WALL=.*|WALL="${wall}/bin/wall"|g' \
|
||||||
-e 's|^HOSTNAME=.*|HOSTNAME=`${nettools}/bin/hostname`|g' \
|
-e 's|^HOSTNAME=.*|HOSTNAME=`${hostname}/bin/hostname`|g' \
|
||||||
"$file"
|
"$file"
|
||||||
done
|
done
|
||||||
'';
|
'';
|
||||||
|
@ -4608,11 +4608,7 @@ with pkgs;
|
|||||||
v8 = v8_static;
|
v8 = v8_static;
|
||||||
};
|
};
|
||||||
|
|
||||||
rsnapshot = callPackage ../tools/backup/rsnapshot {
|
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;
|
|
||||||
};
|
|
||||||
|
|
||||||
rlwrap = callPackage ../tools/misc/rlwrap { };
|
rlwrap = callPackage ../tools/misc/rlwrap { };
|
||||||
|
|
||||||
@ -7659,7 +7655,6 @@ with pkgs;
|
|||||||
inherit (perlPackages) perl
|
inherit (perlPackages) perl
|
||||||
ExporterLite FileWhich GetoptTabular RegexpCommon TermReadKey;
|
ExporterLite FileWhich GetoptTabular RegexpCommon TermReadKey;
|
||||||
inherit (llvmPackages_4) llvm clang-unwrapped;
|
inherit (llvmPackages_4) llvm clang-unwrapped;
|
||||||
utillinux = if stdenv.isLinux then utillinuxMinimal else null;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
cscope = callPackage ../development/tools/misc/cscope { };
|
cscope = callPackage ../development/tools/misc/cscope { };
|
||||||
@ -13091,7 +13086,7 @@ with pkgs;
|
|||||||
})
|
})
|
||||||
else if stdenv.isLinux
|
else if stdenv.isLinux
|
||||||
then utillinuxMinimal
|
then utillinuxMinimal
|
||||||
else null;
|
else libossp_uuid;
|
||||||
|
|
||||||
light = callPackage ../os-specific/linux/light { };
|
light = callPackage ../os-specific/linux/light { };
|
||||||
|
|
||||||
@ -13099,8 +13094,6 @@ with pkgs;
|
|||||||
|
|
||||||
ebtables = callPackage ../os-specific/linux/ebtables { };
|
ebtables = callPackage ../os-specific/linux/ebtables { };
|
||||||
|
|
||||||
eject = utillinux;
|
|
||||||
|
|
||||||
facetimehd-firmware = callPackage ../os-specific/linux/firmware/facetimehd-firmware { };
|
facetimehd-firmware = callPackage ../os-specific/linux/firmware/facetimehd-firmware { };
|
||||||
|
|
||||||
fatrace = callPackage ../os-specific/linux/fatrace { };
|
fatrace = callPackage ../os-specific/linux/fatrace { };
|
||||||
@ -14017,7 +14010,7 @@ with pkgs;
|
|||||||
ncurses = null;
|
ncurses = null;
|
||||||
perl = null;
|
perl = null;
|
||||||
systemd = null;
|
systemd = null;
|
||||||
}) else throw "utillinux is unsupported on non-Linux";
|
}) else utillinux;
|
||||||
|
|
||||||
v4l_utils = qt5.callPackage ../os-specific/linux/v4l-utils { };
|
v4l_utils = qt5.callPackage ../os-specific/linux/v4l-utils { };
|
||||||
|
|
||||||
@ -21142,5 +21135,5 @@ with pkgs;
|
|||||||
|
|
||||||
# Unix tools
|
# Unix tools
|
||||||
unixtools = recurseIntoAttrs (callPackages ./unix-tools.nix { });
|
unixtools = recurseIntoAttrs (callPackages ./unix-tools.nix { });
|
||||||
inherit (unixtools) hexdump ps sysctl;
|
inherit (unixtools) hexdump ps logger eject modprobe umount mount wall hostname more;
|
||||||
}
|
}
|
||||||
|
@ -7328,7 +7328,7 @@ let self = _self // overrides; _self = with self; {
|
|||||||
url = "mirror://cpan/authors/id/J/JP/JPIERCE/IO-Pager-${version}.tgz";
|
url = "mirror://cpan/authors/id/J/JP/JPIERCE/IO-Pager-${version}.tgz";
|
||||||
sha256 = "0ksldcw0hydfy9k70i6q6fm1wgbc54kx0lbwlkrszsbd7q72dlfg";
|
sha256 = "0ksldcw0hydfy9k70i6q6fm1wgbc54kx0lbwlkrszsbd7q72dlfg";
|
||||||
};
|
};
|
||||||
propagatedBuildInputs = [pkgs.utillinux.bin]; # `more` used in tests
|
propagatedBuildInputs = [pkgs.more]; # `more` used in tests
|
||||||
};
|
};
|
||||||
|
|
||||||
IOPrompt = buildPerlPackage {
|
IOPrompt = buildPerlPackage {
|
||||||
|
@ -1,5 +1,15 @@
|
|||||||
{ pkgs, buildEnv, runCommand, hostPlatform }:
|
{ 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
|
let
|
||||||
|
|
||||||
singleBinary = cmd: providers:
|
singleBinary = cmd: providers:
|
||||||
@ -17,10 +27,22 @@ let
|
|||||||
else throw "${hostPlatform.parsed.kernel.name} does not have ${cmd}";
|
else throw "${hostPlatform.parsed.kernel.name} does not have ${cmd}";
|
||||||
|
|
||||||
in rec {
|
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" {
|
arp = singleBinary "arp" {
|
||||||
linux = pkgs.nettools;
|
linux = pkgs.nettools;
|
||||||
darwin = pkgs.darwin.network_cmds;
|
darwin = pkgs.darwin.network_cmds;
|
||||||
};
|
};
|
||||||
|
eject = singleBinary "eject" {
|
||||||
|
linux = pkgs.utillinux;
|
||||||
|
};
|
||||||
getopt = singleBinary "getopt" {
|
getopt = singleBinary "getopt" {
|
||||||
linux = pkgs.utillinux;
|
linux = pkgs.utillinux;
|
||||||
darwin = pkgs.darwin.shell_cmds;
|
darwin = pkgs.darwin.shell_cmds;
|
||||||
@ -37,6 +59,19 @@ in rec {
|
|||||||
linux = pkgs.nettools;
|
linux = pkgs.nettools;
|
||||||
darwin = pkgs.darwin.network_cmds;
|
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" {
|
netstat = singleBinary "netstat" {
|
||||||
linux = pkgs.nettools;
|
linux = pkgs.nettools;
|
||||||
darwin = pkgs.darwin.network_cmds;
|
darwin = pkgs.darwin.network_cmds;
|
||||||
@ -61,16 +96,23 @@ in rec {
|
|||||||
linux = pkgs.procps;
|
linux = pkgs.procps;
|
||||||
darwin = pkgs.darwin.system_cmds;
|
darwin = pkgs.darwin.system_cmds;
|
||||||
};
|
};
|
||||||
|
umount = singleBinary "umount" {
|
||||||
|
linux = pkgs.utillinux;
|
||||||
|
};
|
||||||
whereis = singleBinary "whereis" {
|
whereis = singleBinary "whereis" {
|
||||||
linux = pkgs.utillinux;
|
linux = pkgs.utillinux;
|
||||||
darwin = pkgs.darwin.shell_cmds;
|
darwin = pkgs.darwin.shell_cmds;
|
||||||
};
|
};
|
||||||
|
wall = singleBinary "wall" {
|
||||||
|
linux = pkgs.utillinux;
|
||||||
|
};
|
||||||
write = singleBinary "write" {
|
write = singleBinary "write" {
|
||||||
linux = pkgs.utillinux;
|
linux = pkgs.utillinux;
|
||||||
darwin = pkgs.darwin.basic_cmds;
|
darwin = pkgs.darwin.basic_cmds;
|
||||||
};
|
};
|
||||||
|
|
||||||
# Compatibility derivations
|
# Compatibility derivations
|
||||||
|
# Provided for old usage of these commands.
|
||||||
|
|
||||||
procps = buildEnv {
|
procps = buildEnv {
|
||||||
name = "procps-compat";
|
name = "procps-compat";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user