Skip to content

Commit

Permalink
nix: Use the current merlin in 'nix develop'
Browse files Browse the repository at this point in the history
The previous devShells installed 'ocaml-lsp', which depended on nixpkgs'
merlin. Since switching to OCaml 5.2 this no longer works but also makes
little sense.

This uses the overrideScope mechanism to make sure that anything added
to the devShells use the current merlin.

Unfortunately, 'ocaml-lsp' is not compatible with the current Merlin and
is dropped from the devShells.
  • Loading branch information
Julow committed May 16, 2024
1 parent 4aacce3 commit 1dd31fc
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@
version = "20201216";
src = menhir-repository;
});

inherit (packages) merlin-lib dot-merlin-reader merlin;
});

inherit (ocamlPackages) buildDunePackage;
in rec {

packages = rec {
default = merlin;
merlin-lib = buildDunePackage {
Expand All @@ -35,6 +37,7 @@
propagatedBuildInputs = with ocamlPackages; [ csexp ];
doCheck = true;
};

dot-merlin-reader = buildDunePackage {
pname = "dot-merlin-reader";
version = "dev";
Expand All @@ -44,6 +47,7 @@
buildInputs = [ merlin-lib ];
doCheck = true;
};

merlin = buildDunePackage {
pname = "merlin";
version = "dev";
Expand All @@ -69,9 +73,12 @@
meta = with pkgs; { mainProgram = "ocamlmerlin"; };
};
};
in {
inherit packages;

devShells.default = pkgs.mkShell {
inputsFrom = pkgs.lib.attrValues packages;
buildInputs = with ocamlPackages; [ ocaml-lsp ];
buildInputs = with ocamlPackages; [ merlin ];
};
});
}

0 comments on commit 1dd31fc

Please sign in to comment.