-
Notifications
You must be signed in to change notification settings - Fork 35
/
Copy pathflake.nix
98 lines (87 loc) · 3.25 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
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
{
description = "Vellvm, a formal specification and interpreter for LLVM";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/master";
flake-utils.url = "github:numtide/flake-utils";
nix-filter.url = "github:numtide/nix-filter";
};
outputs = { self, nixpkgs, flake-utils, nix-filter }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
lib = pkgs.lib;
rocq = pkgs.rocq-core;
rocqPkgs = pkgs.rocqPackages_9_0;
coqPkgs = pkgs.coqPackages_9_0;
version = "vellvm:master";
in rec {
packages = {
default = (pkgs.callPackage ./release.nix ({ nix-filter = nix-filter.lib; perl = pkgs.perl; coq = pkgs.coq; inherit rocq version rocqPkgs coqPkgs; })).vellvm;
};
defaultPackage = packages.default;
app.default = flake-utils.lib.mkApp { drv = packages.default; };
checks = {
vellvm-test-suite =
pkgs.stdenv.mkDerivation {
name = "vellvm-test-suite";
src = ./.;
meta = {
description = "Run the simple suite of vellvm tests";
};
buildInputs = [packages.default];
installPhase = ''
cd src
${packages.default}/bin/vellvm -test-suite
if [[ $? == 0 ]]; then
mkdir $out
fi
'';
};
org-lint =
pkgs.stdenv.mkDerivation {
name = "org-linting";
src = ./.;
meta = {
description = "Ensure that links are still valid within some important org files for artifact submissions :).";
};
buildInputs = [pkgs.emacs];
installPhase = ''
${pkgs.emacs}/bin/emacs --batch -f package-initialize --eval "(add-hook 'org-mode-hook
(lambda ()
(let* ((file-name (current-buffer))
(Col1 'Line)
(Col2 'Trust)
(Col3 'Warning)
(lint-report (org-lint '(link-to-local-file)))
)
(princ (format \"file: %s\n%6s%6s%8s\n\" file-name Col1 Col2 Col3))
(dolist (element lint-report)
(setq report (car (cdr element)))
(princ (format \"%6s%6s %7s\n\" (seq-elt report 0) (seq-elt report 1) (seq-elt report 2)))
)
(if (not (null lint-report))
(kill-emacs 1))
)))" MemoryTour.org
if [[ $? == 0 ]]; then
mkdir $out
fi
'';
};
};
devShells = {
# Include a fixed version of clang in the development environment for testing.
default = pkgs.mkShell {
inputsFrom = [ packages.default];
buildInputs = [ pkgs.clang_19
pkgs.coq # Needed to make proof general happy for development.
pkgs.llvmPackages_19.libllvm
rocq.ocamlPackages.utop
rocq.ocamlPackages.bisect_ppx
rocq.ocamlPackages.ppxlib
pkgs.util-linux
];
};
};
devShell = devShells.default;
});
}