We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents a271889 + 62907a6 commit d9fc91cCopy full SHA for d9fc91c
1 file changed
modules/native.nix
@@ -3,6 +3,19 @@
3
with lib;
4
let
5
cfg = config.typelevelShell.native;
6
+
7
+ clang = if pkgs.stdenv.isLinux then
8
+ pkgs.runCommand "sysrooted-clang" { } ''
9
+ mkdir -p $out/bin
10
+ for bin in clang clang++; do
11
+ cat > $out/bin/$bin <<EOF
12
+#!${pkgs.runtimeShell}
13
+exec "${pkgs.clang}"/bin/$bin --sysroot="${pkgs.glibc.dev}" "\$@"
14
+EOF
15
+ chmod +x $out/bin/$bin
16
+ done
17
+ ''
18
+ else pkgs.clang;
19
in
20
{
21
options.typelevelShell.native = {
@@ -17,7 +30,7 @@ in
30
31
config = mkIf cfg.enable {
32
devshell.packages = [
- pkgs.clang
33
+ clang
34
pkgs.llvmPackages.libcxx
22
35
] ++ flatten (map (e: [ (getDev e) (getLib e) ]) cfg.libraries);
23
36
@@ -30,10 +43,6 @@ in
43
name = "C_INCLUDE_PATH";
44
prefix = "$DEVSHELL_DIR/include";
45
}
- {
- name = "LLVM_BIN";
- value = "${pkgs.clang}/bin";
- }
37
46
];
38
47
};
39
48
0 commit comments