treewide/nixos: use stdenv.cc.libc instead of glibc when available
This prevents duplication in cross-compiled nixos machines. The bootstrapped glibc differs from the natively compiled one, so we get two glibc’s in the closure. To reduce closure size, just use stdenv.cc.libc where available.
This commit is contained in:
@@ -197,7 +197,7 @@ in
|
||||
|
||||
} // optionalAttrs (pkgs.stdenv.hostPlatform.libc == "glibc") {
|
||||
# /etc/rpc: RPC program numbers.
|
||||
rpc.source = pkgs.glibc.out + "/etc/rpc";
|
||||
rpc.source = pkgs.stdenv.cc.libc.out + "/etc/rpc";
|
||||
};
|
||||
|
||||
networking.proxy.envVars =
|
||||
|
||||
@@ -7,6 +7,10 @@ let
|
||||
nssModulesPath = config.system.nssModules.path;
|
||||
cfg = config.services.nscd;
|
||||
|
||||
nscd = if pkgs.stdenv.hostPlatform.libc == "glibc"
|
||||
then pkgs.stdenv.cc.libc.bin
|
||||
else pkgs.glibc.bin;
|
||||
|
||||
in
|
||||
|
||||
{
|
||||
@@ -59,16 +63,16 @@ in
|
||||
# files. So prefix the ExecStart command with "!" to prevent systemd
|
||||
# from dropping privileges early. See ExecStart in systemd.service(5).
|
||||
serviceConfig =
|
||||
{ ExecStart = "!@${pkgs.glibc.bin}/sbin/nscd nscd";
|
||||
{ ExecStart = "!@${nscd}/sbin/nscd nscd";
|
||||
Type = "forking";
|
||||
DynamicUser = true;
|
||||
RuntimeDirectory = "nscd";
|
||||
PIDFile = "/run/nscd/nscd.pid";
|
||||
Restart = "always";
|
||||
ExecReload =
|
||||
[ "${pkgs.glibc.bin}/sbin/nscd --invalidate passwd"
|
||||
"${pkgs.glibc.bin}/sbin/nscd --invalidate group"
|
||||
"${pkgs.glibc.bin}/sbin/nscd --invalidate hosts"
|
||||
[ "${nscd}/sbin/nscd --invalidate passwd"
|
||||
"${nscd}/sbin/nscd --invalidate group"
|
||||
"${nscd}/sbin/nscd --invalidate hosts"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
@@ -66,12 +66,12 @@ let
|
||||
linux = pkgs.utillinux;
|
||||
};
|
||||
getconf = {
|
||||
linux = if stdenv.hostPlatform.libc == "glibc" then pkgs.glibc
|
||||
linux = if stdenv.hostPlatform.libc == "glibc" then pkgs.stdenv.cc.libc
|
||||
else pkgs.netbsd.getconf;
|
||||
darwin = pkgs.darwin.system_cmds;
|
||||
};
|
||||
getent = {
|
||||
linux = if stdenv.hostPlatform.libc == "glibc" then pkgs.glibc
|
||||
linux = if stdenv.hostPlatform.libc == "glibc" then pkgs.stdenv.cc.libc
|
||||
else pkgs.netbsd.getent;
|
||||
darwin = pkgs.netbsd.getent;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user