@@ -0,0 +1,48 @@
1+{ stdenv, fetchFromGitHub, srcOnly, nim }:
2+let
3+ astpatternmatching = fetchFromGitHub {
4+ owner = "krux02";
5+ repo = "ast-pattern-matching";
6+ rev = "87f7d163421af5a4f5e5cb6da7b93278e6897e96";
7+ sha256 = "19mb5bb6riia8380p5dpc3q0vwgrj958dd6p7vw8vkvwiqrzg6zq";
8+ };
9+
10+ jsonschema = fetchFromGitHub {
11+ owner = "PMunch";
12+ repo = "jsonschema";
13+ rev = "7b41c03e3e1a487d5a8f6b940ca8e764dc2cbabf";
14+ sha256 = "1js64jqd854yjladxvnylij4rsz7212k31ks541pqrdzm6hpblbz";
15+ };
16+in
17+stdenv.mkDerivation rec {
18+ pname = "nimlsp";
19+ version = "0.2.6";
20+
21+ src = fetchFromGitHub {
22+ owner = "PMunch";
23+ repo = "nimlsp";
24+ rev = "v${version}";
25+ sha256 = "13kw3zjh0iqymwqxwhyj8jz6hgswwahf1rjd6iad7c6gcwrrg6yl";
26+ };
27+
28+ nativeBuildInputs = [ nim ];
29+
30+ buildPhase = ''
31+ export HOME=$TMPDIR
32+ nim -d:release -p:${astpatternmatching}/src -p:${jsonschema}/src \
33+ c --threads:on -d:nimcore -d:nimsuggest -d:debugCommunication \
34+ -d:debugLogging -d:explicitSourcePath=${srcOnly nim.unwrapped} -d:tempDir=/tmp src/nimlsp
35+ '';
36+
37+ installPhase = ''
38+ install -Dt $out/bin src/nimlsp
39+ '';
40+
41+ meta = with stdenv.lib; {
42+ description = "Language Server Protocol implementation for Nim";
43+ homepage = "https://github.com/PMunch/nimlsp";
44+ license = licenses.mit;
45+ platforms = nim.meta.platforms;
46+ maintainers = [ maintainers.marsam ];
47+ };
48+}