mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-23 07:23:20 +00:00
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:
parent
8a5059e1cc
commit
7cc40e15e4
@ -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;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user