-
Notifications
You must be signed in to change notification settings - Fork 35
/
flake.nix
98 lines (82 loc) · 2.39 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 = "A language server (LSP) for the Coq theorem prover";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
treefmt.url = "github:numtide/treefmt-nix";
napalm.url = "github:nix-community/napalm";
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
};
outputs = inputs @ {
self,
flake-parts,
treefmt,
...
}:
flake-parts.lib.mkFlake {inherit inputs;} {
systems = ["x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin"];
imports = [treefmt.flakeModule ./editor/code/flakeModule.nix];
perSystem = {
config,
pkgs,
lib,
...
}: let
l = lib // builtins;
coqpkg = pkgs.coqPackages_8_20;
coqPackages = coqpkg.coqPackages;
ocamlPackages = coqpkg.coq.ocamlPackages;
in {
packages.default = config.packages.coq-lsp;
packages.coq-lsp = ocamlPackages.buildDunePackage {
duneVersion = "3";
pname = "coq-lsp";
version = "${self.lastModifiedDate}+8.20-rc1";
src = self.outPath;
nativeBuildInputs = l.attrValues {
inherit (ocamlPackages) menhir;
};
propagatedBuildInputs = l.attrValues {
inherit
(ocamlPackages)
cmdliner
findlib
ppx_deriving
ppx_deriving_yojson
ppx_import
ppx_sexp_conv
ppx_hash
sexplib
yojson
zarith
uri
dune-build-info
ppx_inline_test
logs
lwt
;
};
};
treefmt.config = {
projectRootFile = "dune-project";
flakeFormatter = true;
settings.global.excludes = ["./vendor/**" "controller-js/js_stub/**"];
programs.alejandra.enable = true;
programs.ocamlformat = {
enable = true;
configFile = ./.ocamlformat;
};
};
devShells.default = pkgs.mkShell {
inputsFrom = [config.packages.coq-lsp];
packages = l.attrValues {
inherit (config.treefmt.build) wrapper;
inherit (pkgs) dune_3 nodejs dune-release;
inherit (ocamlPackages) ocaml ocamlformat ocaml-lsp;
};
};
};
};
}