From f94c9c545918f39cb8a84a40049077c542dc1730 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Tue, 10 Apr 2018 18:53:09 -0500 Subject: [PATCH 1/4] unix-tools: provide getconf and getent --- pkgs/top-level/all-packages.nix | 11 ++--------- pkgs/top-level/unix-tools.nix | 7 +++++++ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 72a2fb90f4b..7f7c74611e1 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -13703,14 +13703,6 @@ with pkgs; musl-fts = callPackage ../os-specific/linux/musl/fts.nix { }; musl-getconf = callPackage ../os-specific/linux/musl/getconf.nix { }; musl-getent = callPackage ../os-specific/linux/musl/getent.nix { }; - getent = - if hostPlatform.isMusl then musl-getent - # This may not be right on other platforms, but preserves existing behavior - else /* if hostPlatform.libc == "glibc" then */ glibc.bin; - - getconf = - if hostPlatform.isMusl then musl-getconf - else lib.getBin stdenv.cc.libc; nettools = if stdenv.isLinux then callPackage ../os-specific/linux/net-tools { } else unixtools.nettools; @@ -21228,5 +21220,6 @@ with pkgs; # Unix tools unixtools = recurseIntoAttrs (callPackages ./unix-tools.nix { }); inherit (unixtools) hexdump ps logger eject modprobe umount - mount wall hostname more sysctl; + mount wall hostname more sysctl getconf + getent; } diff --git a/pkgs/top-level/unix-tools.nix b/pkgs/top-level/unix-tools.nix index 0d6e8d1c6c2..69bd6b7a7cc 100644 --- a/pkgs/top-level/unix-tools.nix +++ b/pkgs/top-level/unix-tools.nix @@ -44,6 +44,13 @@ in rec { eject = singleBinary "eject" { linux = pkgs.utillinux; }; + getconf = singleBinary "getconf" { + linux = pkgs.musl-getconf; + darwin = pkgs.system_cmds; + }; + getent = singleBinary "getconf" { + linux = pkgs.musl-getent; + }; getopt = singleBinary "getopt" { linux = pkgs.utillinux; darwin = pkgs.getopt; From 037e5d863b6797270607cd7e148bff71e6eb384e Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Tue, 10 Apr 2018 18:54:11 -0500 Subject: [PATCH 2/4] rabbitmq-server: use provided getconf --- pkgs/servers/amqp/rabbitmq-server/default.nix | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/pkgs/servers/amqp/rabbitmq-server/default.nix b/pkgs/servers/amqp/rabbitmq-server/default.nix index 3d4a8902c91..4cc187846d0 100644 --- a/pkgs/servers/amqp/rabbitmq-server/default.nix +++ b/pkgs/servers/amqp/rabbitmq-server/default.nix @@ -1,17 +1,11 @@ { stdenv, fetchurl, runCommand , erlang, python, libxml2, libxslt, xmlto , docbook_xml_dtd_45, docbook_xsl, zip, unzip, rsync - , AppKit, Carbon, Cocoa +, getconf }: -let - # we only need that one glibc binary (28k instead of 2.7M) - getconf = runCommand "getconf" {} '' - install -D ${stdenv.lib.getBin stdenv.cc.libc}/bin/getconf $out/bin/getconf - ''; - -in stdenv.mkDerivation rec { +stdenv.mkDerivation rec { name = "rabbitmq-server-${version}"; version = "3.6.15"; From 70c378891e923f8983d905fb76d30bf86b03a5c8 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Tue, 10 Apr 2018 18:55:25 -0500 Subject: [PATCH 3/4] unix-tools: copy instead of linking This prevents big closures from getting pulled in. --- pkgs/top-level/unix-tools.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/top-level/unix-tools.nix b/pkgs/top-level/unix-tools.nix index 69bd6b7a7cc..919ff9e8106 100644 --- a/pkgs/top-level/unix-tools.nix +++ b/pkgs/top-level/unix-tools.nix @@ -24,7 +24,7 @@ let exit 1 fi - ln -s "${provider}" "$out/bin/${cmd}" + cp "${provider}" "$out/bin/${cmd}" ''; in rec { From 50bdc5a6128a84dbf5b45543cdb306296fda74d4 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Tue, 10 Apr 2018 21:18:42 -0500 Subject: [PATCH 4/4] unix-tools: fix typo --- pkgs/top-level/unix-tools.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/top-level/unix-tools.nix b/pkgs/top-level/unix-tools.nix index 919ff9e8106..19e315f6f60 100644 --- a/pkgs/top-level/unix-tools.nix +++ b/pkgs/top-level/unix-tools.nix @@ -46,7 +46,7 @@ in rec { }; getconf = singleBinary "getconf" { linux = pkgs.musl-getconf; - darwin = pkgs.system_cmds; + darwin = pkgs.darwin.system_cmds; }; getent = singleBinary "getconf" { linux = pkgs.musl-getent;