nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 metaFetch,
3 coq,
4 rocq-core,
5 lib,
6 glib,
7 adwaita-icon-theme,
8 wrapGAppsHook3,
9 version ? null,
10}:
11
12let
13 ocamlPackages = rocq-core.ocamlPackages;
14 defaultVersion =
15 let
16 case = case: out: { inherit case out; };
17 in
18 lib.switch rocq-core.rocq-version [
19 # When updating the default version here, also update the VsRocq VS Code extension
20 (case (lib.versions.range "8.18" "9.1") "2.3.4")
21 ] null;
22 location = {
23 domain = "github.com";
24 owner = "rocq-prover";
25 repo = "vsrocq";
26 };
27 fetch = metaFetch {
28 release."2.3.0".rev = "v2.3.0";
29 release."2.3.0".sha256 = "sha256-BZLxcCmSGFf04eUmlJXnyxmg4hTwpFaPaIik4VD444M=";
30 release."2.3.3".rev = "v2.3.3";
31 release."2.3.3".sha256 = "sha256-wgn28wqWhZS4UOLUblkgXQISgLV+XdSIIEMx9uMT/ig=";
32 release."2.3.4".rev = "v2.3.4";
33 release."2.3.4".sha256 = "sha256-v1hQjE8U1o2VYOlUjH0seIsNG+NrMNZ8ixt4bQNyGvI=";
34 inherit location;
35 };
36 fetched = fetch (if version != null then version else defaultVersion);
37in
38ocamlPackages.buildDunePackage {
39 pname = "vsrocq-language-server";
40 inherit (fetched) version;
41 src = "${fetched.src}/language-server";
42 nativeBuildInputs = [ coq ];
43 buildInputs = [
44 coq
45 glib
46 adwaita-icon-theme
47 wrapGAppsHook3
48 ]
49 ++ (with ocamlPackages; [
50 findlib
51 lablgtk3-sourceview3
52 zarith
53 ppx_inline_test
54 ppx_assert
55 ppx_sexp_conv
56 ppx_deriving
57 ppx_import
58 sexplib
59 (ppx_yojson_conv.override {
60 ppx_yojson_conv_lib = ppx_yojson_conv_lib.override { yojson = yojson_2; };
61 })
62 lsp
63 sel
64 ppx_optcomp
65 ]);
66 preBuild = ''
67 make dune-files
68 '';
69
70 meta = {
71 description = "Language server for the vsrocq vscode/codium extension";
72 homepage = "https://github.com/rocq-prover/vsrocq";
73 maintainers = with lib.maintainers; [ cohencyril ];
74 license = lib.licenses.mit;
75 }
76 // lib.optionalAttrs (fetched.broken or false) {
77 broken = true;
78 };
79}