-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathflake.nix
206 lines (176 loc) · 6.12 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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
{
description = "An infinity-categorical coherence typechecker";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
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; });
ocamlPackages = pkgs.ocaml-ng.ocamlPackages_4_14;
sources = {
catt = nix-filter.lib {
root = ./.;
include = [
".ocamlformat"
"dune-project"
(nix-filter.lib.inDirectory "bin")
(nix-filter.lib.inDirectory "lib")
(nix-filter.lib.inDirectory "test.t")
];
};
web = nix-filter.lib {
root = ./.;
include = [
".ocamlformat"
"dune-project"
(nix-filter.lib.inDirectory "web")
];
};
coq-plugin = nix-filter.lib {
root = ./.;
include = [
".ocamlformat"
"dune-project"
(nix-filter.lib.inDirectory "coq_plugin")
(nix-filter.lib.inDirectory "test.t")
];
};
ocaml = nix-filter.lib {
root = ./.;
include = [
".ocamlformat"
"dune-project"
(nix-filter.lib.inDirectory "bin")
(nix-filter.lib.inDirectory "lib")
(nix-filter.lib.inDirectory "test.t")
(nix-filter.lib.inDirectory "web")
(nix-filter.lib.inDirectory "coq_plugin/src/")
"coq_plugin/theories/dune"
];
};
nix = nix-filter.lib {
root = ./.;
include = [ (nix-filter.lib.matchExt "nix") ];
};
elisp = ./share/site-lisp;
};
in {
packages = {
default = self.packages.${system}.catt;
catt = ocamlPackages.buildDunePackage {
pname = "catt";
version = "1.0";
minimalOcamlVersion = "4.14";
doCheck = false;
src = sources.catt;
nativeBuildInputs = with ocamlPackages; [ menhir ];
propagatedBuildInputs = with ocamlPackages; [ base ];
meta = {
description = "A proof assistant for weak omega-categories";
homepage = "https://www.github.com/thibautbenjamin/catt";
license = nixpkgs.lib.licenses.mit;
maintainers = [ "Thibaut Benjamin" "Chiara Sarti" ];
mainProgram = "catt";
};
};
catt-web = ocamlPackages.buildDunePackage {
pname = "catt-web";
version = "1.0";
minimalOcamlVersion = "4.14";
doCheck = false;
src = sources.web;
nativeBuildInputs = with ocamlPackages; [ js_of_ocaml ];
buildInputs = with ocamlPackages; [
js_of_ocaml
self.outputs.packages.${system}.catt
js_of_ocaml-ppx
];
meta = {
description =
"Browser embedded version of the catt proof-assistant";
homepage = "https://www.github.com/thibautbenjamin/catt";
license = nixpkgs.lib.licenses.mit;
maintainers = [ "Thibaut Benjamin" "Chiara Sarti" ];
};
};
catt-coq-plugin = pkgs.coqPackages.mkCoqDerivation {
pname = "catt-plugin";
version = "1.0";
src = sources.coq-plugin;
nativeBuildInputs = [ ];
buildInputs =
[ self.packages.${system}.catt pkgs.dune_3 pkgs.opam pkgs.coq ];
mlPlugin = true;
useDune = true;
meta = {
description = "Coq plugin for the catt proof-assistant";
homepage = "https://www.github.com/thibautbenjamin/catt";
license = nixpkgs.lib.licenses.mit;
maintainers = [ "Thibaut Benjamin" "Chiara Sarti" ];
};
};
catt-mode = pkgs.emacs.pkgs.trivialBuild rec {
pname = "catt-mode";
version = "1.0";
src = sources.elisp;
meta = {
description = "An emacs mode for the catt proof-assistant";
homepage = "https://www.github.com/thibautbenjamin/catt";
license = pkgs.lib.licenses.mit;
maintainers = [ "Thibaut Benjamin" ];
};
};
};
formatter = pkgs.nixfmt-classic;
checks = {
lint-nix = pkgs.runCommand "check-flake-format" {
nativeBuildInputs = [ pkgs.nixfmt-classic ];
} ''
echo "checking nix formatting"
nixfmt --check ${sources.nix}
touch $out
'';
dune-fmt = pkgs.runCommand "check-ocaml-fmt" {
nativeBuildInputs = [
ocamlPackages.dune_3
ocamlPackages.ocaml
ocamlPackages.ocamlformat
];
} ''
echo "checking dune and ocaml formatting for catt"
dune fmt \
--display=short \
--root=$(pwd)
touch $out
'';
default = self.packages.${system}.catt.overrideAttrs (oldAttrs: {
name = "check-${oldAttrs.name}";
dontInstall = true;
doCheck = true;
});
};
devShells.default = pkgs.mkShell {
packages = (with pkgs; [ nixfmt-classic fswatch ])
++ (with ocamlPackages; [
odoc
ocaml-lsp
ocamlformat
ocp-indent
ocamlformat-rpc-lib
landmarks
landmarks-ppx
utop
dune-release
]);
inputsFrom = [
self.packages.${system}.catt
self.packages.${system}.catt-web
self.packages.${system}.catt-coq-plugin
];
};
devShells.web = self.packages.${system}.catt-web;
});
}