summary refs log tree commit diff
path: root/pkgs/top-level/unix-tools.nix
diff options
context:
space:
mode:
authorMatthew Justin Bauer <mjbauer95@gmail.com>2018-04-11 12:46:53 -0500
committerGitHub <noreply@github.com>2018-04-11 12:46:53 -0500
commit27dd87222769bc602d34c5a5c2a13f492f432dbe (patch)
tree179faeaf66062427df05c7c49f19ff4bd828da31 /pkgs/top-level/unix-tools.nix
parentce5455b2ba6f447982211c7a37576857c403b06c (diff)
downloadnixlib-27dd87222769bc602d34c5a5c2a13f492f432dbe.tar
nixlib-27dd87222769bc602d34c5a5c2a13f492f432dbe.tar.gz
nixlib-27dd87222769bc602d34c5a5c2a13f492f432dbe.tar.bz2
nixlib-27dd87222769bc602d34c5a5c2a13f492f432dbe.tar.lz
nixlib-27dd87222769bc602d34c5a5c2a13f492f432dbe.tar.xz
nixlib-27dd87222769bc602d34c5a5c2a13f492f432dbe.tar.zst
nixlib-27dd87222769bc602d34c5a5c2a13f492f432dbe.zip
unix-tools: fixup
Diffstat (limited to 'pkgs/top-level/unix-tools.nix')
-rw-r--r--pkgs/top-level/unix-tools.nix11
1 files changed, 7 insertions, 4 deletions
diff --git a/pkgs/top-level/unix-tools.nix b/pkgs/top-level/unix-tools.nix
index 19e315f6f603..16c2a6b77bfe 100644
--- a/pkgs/top-level/unix-tools.nix
+++ b/pkgs/top-level/unix-tools.nix
@@ -1,4 +1,4 @@
-{ pkgs, buildEnv, runCommand, hostPlatform }:
+{ pkgs, buildEnv, runCommand, hostPlatform, stdenv, lib }:
 
 # These are some unix tools that are commonly included in the /usr/bin
 # and /usr/sbin directory under more normal distributions. Along with
@@ -45,11 +45,14 @@ in rec {
     linux = pkgs.utillinux;
   };
   getconf = singleBinary "getconf" {
-    linux = pkgs.musl-getconf;
+    linux = if hostPlatform.isMusl then pkgs.musl-getconf
+            else lib.getBin stdenv.cc.libc;
     darwin = pkgs.darwin.system_cmds;
   };
-  getent = singleBinary "getconf" {
-    linux = pkgs.musl-getent;
+  getent = singleBinary "getent" {
+    linux = if hostPlatform.isMusl then pkgs.musl-getent
+            # This may not be right on other platforms, but preserves existing behavior
+            else /* if hostPlatform.libc == "glibc" then */ pkgs.glibc.bin;
   };
   getopt = singleBinary "getopt" {
     linux = pkgs.utillinux;