forked from mirrors/nixpkgs
nixos/nix-ld: also include ld.so in nixos profile
This commit is contained in:
parent
f3ae11b096
commit
b60f21e135
|
@ -2,15 +2,14 @@
|
|||
let
|
||||
cfg = config.programs.nix-ld;
|
||||
|
||||
# TODO make glibc here configurable?
|
||||
nix-ld-so = pkgs.runCommand "ld.so" {} ''
|
||||
ln -s "$(cat '${pkgs.stdenv.cc}/nix-support/dynamic-linker')" $out
|
||||
'';
|
||||
|
||||
nix-ld-libraries = pkgs.buildEnv {
|
||||
name = "lb-library-path";
|
||||
pathsToLink = [ "/lib" ];
|
||||
paths = map lib.getLib cfg.libraries;
|
||||
# TODO make glibc here configurable?
|
||||
postBuild = ''
|
||||
ln -s ${pkgs.stdenv.cc.bintools.dynamicLinker} $out/share/nix-ld/lib/ld.so
|
||||
'';
|
||||
extraPrefix = "/share/nix-ld";
|
||||
ignoreCollisions = true;
|
||||
};
|
||||
|
@ -60,7 +59,7 @@ in
|
|||
environment.pathsToLink = [ "/share/nix-ld" ];
|
||||
|
||||
environment.variables = {
|
||||
NIX_LD = toString nix-ld-so;
|
||||
NIX_LD = "/run/current-system/sw/share/nix-ld/lib/ld.so";
|
||||
NIX_LD_LIBRARY_PATH = "/run/current-system/sw/share/nix-ld/lib";
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue