-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
111 lines (107 loc) · 3.06 KB
/
Copy pathflake.nix
File metadata and controls
111 lines (107 loc) · 3.06 KB
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
{
description = "llvm-bleach";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
treefmt-nix = {
url = "github:numtide/treefmt-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
{
self,
nixpkgs,
flake-parts,
treefmt-nix,
...
}@inputs:
let
systemToMusl = {
"x86_64-linux" = "x86_64-unknown-linux-musl";
"aarch64-linux" = "aarch64-unknown-linux-musl";
};
in
flake-parts.lib.mkFlake { inherit inputs; } {
imports = [ treefmt-nix.flakeModule ];
systems = [
"x86_64-linux"
"aarch64-linux"
];
perSystem =
{ pkgs, system, ... }:
rec {
imports = [ ./nix/treefmt.nix ];
legacyPackages = {
bleachPkgsStatic = import nixpkgs {
localSystem = {
inherit system;
};
crossSystem = {
inherit system;
libc = "musl";
config = systemToMusl.${system};
isStatic = true;
};
};
bleachPkgs = import nixpkgs { inherit system; };
};
packages =
let
normalPkgs = legacyPackages.bleachPkgs;
staticPkgs = legacyPackages.bleachPkgsStatic;
llvmPackages = normalPkgs.llvmPackages_21;
in
rec {
llvm-bleach = normalPkgs.callPackage ./. {
inherit self;
inherit llvmPackages;
inherit llvmSnippy;
llvmLib = llvmPackages.llvm;
clangCompiler = normalPkgs.clang;
};
llvm-bleach-static = staticPkgs.callPackage ./. {
inherit llvmPackages;
llvmLib = staticPkgs.llvmPackages_21.llvm;
clangCompiler = normalPkgs.clang;
inherit llvmSnippy;
inherit (normalPkgs)
lit
filecheck
yq
jq
ruby
rubygtest
pandoc
gtest
qemu
;
};
default = llvm-bleach;
llvmSnippy = pkgs.callPackage ./snippy.nix {
stdenv = llvmPackages.stdenv;
};
};
checks = {
inherit (packages) llvm-bleach;
};
devShells.default = pkgs.mkShell {
nativeBuildInputs =
packages.llvm-bleach.nativeBuildInputs
++ (with pkgs; [
doxygen
clang-tools
lit
filecheck
act
lldb
gdb
valgrind
just
]);
buildInputs = packages.llvm-bleach.buildInputs;
};
devShells.withBleach = pkgs.mkShell { nativeBuildInputs = [ packages.llvm-bleach-static ]; };
};
};
}