diff options
author | Matthew Bauer <mjbauer95@gmail.com> | 2018-03-26 22:37:49 -0500 |
---|---|---|
committer | Matthew Bauer <mjbauer95@gmail.com> | 2018-03-27 18:17:45 -0500 |
commit | 4a9fddc59863c3c2077e35bff913dd664c8b6e1a (patch) | |
tree | 3378cf05f04b3ad2d32f8dfc0149129f3a7340ab /pkgs/top-level/unix-tools.nix | |
parent | 35d6688a1b1e4941344cdbc1b46e4fc2c8cd1255 (diff) | |
download | nixlib-4a9fddc59863c3c2077e35bff913dd664c8b6e1a.tar nixlib-4a9fddc59863c3c2077e35bff913dd664c8b6e1a.tar.gz nixlib-4a9fddc59863c3c2077e35bff913dd664c8b6e1a.tar.bz2 nixlib-4a9fddc59863c3c2077e35bff913dd664c8b6e1a.tar.lz nixlib-4a9fddc59863c3c2077e35bff913dd664c8b6e1a.tar.xz nixlib-4a9fddc59863c3c2077e35bff913dd664c8b6e1a.tar.zst nixlib-4a9fddc59863c3c2077e35bff913dd664c8b6e1a.zip |
unixtools: cleanup
Diffstat (limited to 'pkgs/top-level/unix-tools.nix')
-rw-r--r-- | pkgs/top-level/unix-tools.nix | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/pkgs/top-level/unix-tools.nix b/pkgs/top-level/unix-tools.nix index 706cd061b591..0c6b9e261dd8 100644 --- a/pkgs/top-level/unix-tools.nix +++ b/pkgs/top-level/unix-tools.nix @@ -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"; |