-
Notifications
You must be signed in to change notification settings - Fork 2
/
stdenv.nix
45 lines (43 loc) · 1.07 KB
/
stdenv.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
{pkgs}:
# Bootstrap a new stdenv that includes our nss_sss in glibc
let
glibc = pkgs.glibc.overrideDerivation (old: {
postPatch =
(old.postPatch or "")
+ ''
sed -i -e 's@_PATH_VARDB.*@_PATH_VARDB "/var/lib/misc"@' sysdeps/unix/sysv/linux/paths.h
sed -i -e 's@_PATH_VARDB.*@_PATH_VARDB "/var/lib/misc"@' sysdeps/generic/paths.h
'';
postInstall =
old.postInstall
+ ''
ln -s ${pkgs.nss_sss}/lib/*.so.* $out/lib
'';
});
binutils = pkgs.binutils.override {
libc = glibc;
};
gcc = pkgs.gcc.override {
bintools = binutils;
libc = glibc;
};
thisStdenv = pkgs.stdenv.override {
cc = gcc;
overrides = self: super: {
inherit glibc binutils gcc;
inherit (pkgs) fetchurl;
};
allowedRequisites =
pkgs.stdenv.allowedRequisites
++ [glibc.out glibc.dev glibc.bin binutils pkgs.nss_sss];
};
in
thisStdenv
# (prevStage: {
# inherit config overlays;
# stdenv = import ./generic {
# }
# })
# (vanillaPackages: {
# config.replaceStdenv vanillaPackages -> stdenv
# })