-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathnix-ld.nix
44 lines (41 loc) · 1.18 KB
/
nix-ld.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
topLevel@{ flake-parts-lib, inputs, ... }: {
imports = [
./common.nix
inputs.flake-parts.flakeModules.flakeModules
];
flake.flakeModules.nixLd = {
imports = [
topLevel.config.flake.flakeModules.common
];
options.perSystem = flake-parts-lib.mkPerSystemOption ({ system, lib, config, pkgs, ... }: {
ml-ops.common = { config, ... }: {
options.nixLdLibraries = lib.mkOption {
type = lib.types.listOf lib.types.path;
};
config.nixLdLibraries = builtins.filter (package: !package.meta.unsupported) [
pkgs.zlib
pkgs.zstd
pkgs.stdenv.cc.cc
pkgs.curl
pkgs.openssl
pkgs.attr
pkgs.libssh
pkgs.bzip2
pkgs.libxml2
pkgs.acl
pkgs.libsodium
pkgs.util-linux
pkgs.xz
pkgs.systemd
];
config.environmentVariables = {
NIX_LD =
toString (pkgs.runCommand "ld.so" { } ''
ln -s "$(cat '${pkgs.stdenv.cc}/nix-support/dynamic-linker')" $out
'');
NIX_LD_LIBRARY_PATH = lib.makeLibraryPath config.nixLdLibraries;
};
};
});
};
}