-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
56 lines (54 loc) · 1.87 KB
/
flake.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
45
46
47
48
49
50
51
52
53
54
55
56
{
description = "Flake shell";
# inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
inputs.nixpkgs.url = "github:gen740/nixpkgs/cxx-import-std";
inputs.flake-utils.url = "github:numtide/flake-utils";
outputs =
{ nixpkgs, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (
system: with nixpkgs.legacyPackages.${system}; {
devShells.default = mkShellNoCC {
packages = [
llvmPackages_19.clang-tools
(llvmPackages_19.libcxxClang.overrideAttrs (oldAttrs: {
postFixup =
oldAttrs.postFixup
+ ''
ln -sf ${oldAttrs.passthru.libcxx}/lib/libc++.modules.json $out/resource-root/libc++.modules.json
ln -sf ${oldAttrs.passthru.libcxx}/share $out
'';
}))
(cmake.overrideAttrs (oldAttrs: {
version = "3.30.2";
src = oldAttrs.src.overrideAttrs { outputHash = null; };
}))
ninja
];
};
defaultPackage = stdenv.mkDerivation {
name = "import_std_example";
src = ./.;
nativeBuildInputs = [
llvmPackages_19.clang-tools
(llvmPackages_19.libcxxClang.overrideAttrs (oldAttrs: {
postFixup =
oldAttrs.postFixup
+ ''
ln -sf ${oldAttrs.passthru.libcxx}/lib/libc++.modules.json $out/resource-root/libc++.modules.json
ln -sf ${oldAttrs.passthru.libcxx}/share $out
'';
}))
(cmake.overrideAttrs (oldAttrs: {
version = "3.30.2";
src = oldAttrs.src.overrideAttrs { outputHash = null; };
}))
ninja
];
installPhase = ''
mkdir -p $out/bin
cp main $out/bin
'';
};
}
);
}