nimlsp: convert to buildNimPackage

This commit is contained in:
Emery Hemingway 2021-09-02 18:24:10 +02:00
parent 724bde1acf
commit 766671c7fd
4 changed files with 31 additions and 26 deletions

View file

@ -0,0 +1,8 @@
{ fetchFromGitHub }:
fetchFromGitHub {
owner = "krux02";
repo = "ast-pattern-matching";
rev = "87f7d163421af5a4f5e5cb6da7b93278e6897e96";
sha256 = "19mb5bb6riia8380p5dpc3q0vwgrj958dd6p7vw8vkvwiqrzg6zq";
}

View file

@ -0,0 +1,8 @@
{ fetchFromGitHub }:
fetchFromGitHub {
owner = "PMunch";
repo = "jsonschema";
rev = "7b41c03e3e1a487d5a8f6b940ca8e764dc2cbabf";
sha256 = "1js64jqd854yjladxvnylij4rsz7212k31ks541pqrdzm6hpblbz";
}

View file

@ -1,22 +1,9 @@
{ lib, stdenv, fetchFromGitHub, srcOnly, nim }:
let
astpatternmatching = fetchFromGitHub {
owner = "krux02";
repo = "ast-pattern-matching";
rev = "87f7d163421af5a4f5e5cb6da7b93278e6897e96";
sha256 = "19mb5bb6riia8380p5dpc3q0vwgrj958dd6p7vw8vkvwiqrzg6zq";
};
{ lib, nimPackages, fetchFromGitHub, srcOnly, nim }:
jsonschema = fetchFromGitHub {
owner = "PMunch";
repo = "jsonschema";
rev = "7b41c03e3e1a487d5a8f6b940ca8e764dc2cbabf";
sha256 = "1js64jqd854yjladxvnylij4rsz7212k31ks541pqrdzm6hpblbz";
};
in
stdenv.mkDerivation rec {
nimPackages.buildNimPackage rec {
pname = "nimlsp";
version = "0.3.2";
nimBinOnly = true;
src = fetchFromGitHub {
owner = "PMunch";
@ -25,18 +12,15 @@ stdenv.mkDerivation rec {
sha256 = "1lm823nvpp3bj9527jd8n1jxh6y8p8ngkfkj91p94m7ffai6jazq";
};
nativeBuildInputs = [ nim ];
buildInputs = with nimPackages; [ astpatternmatching jsonschema ];
buildPhase = ''
export HOME=$TMPDIR
nim -d:release -p:${astpatternmatching}/src -p:${jsonschema}/src \
c --threads:on -d:nimcore -d:nimsuggest -d:debugCommunication \
-d:debugLogging -d:explicitSourcePath=${srcOnly nim.passthru.nim} -d:tempDir=/tmp src/nimlsp
'';
nimFlags = [
"--threads:on"
"-d:explicitSourcePath=${srcOnly nimPackages.nim.passthru.nim}"
"-d:tempDir=/tmp"
];
installPhase = ''
install -Dt $out/bin src/nimlsp
'';
nimDefines = [ "nimcore" "nimsuggest" "debugCommunication" "debugLogging" ];
meta = with lib; {
description = "Language Server Protocol implementation for Nim";

View file

@ -9,6 +9,9 @@ lib.makeScope newScope (self:
callPackage ../development/nim-packages/build-nim-package { };
fetchNimble = callPackage ../development/nim-packages/fetch-nimble { };
astpatternmatching =
callPackage ../development/nim-packages/astpatternmatching { };
bumpy = callPackage ../development/nim-packages/bumpy { };
chroma = callPackage ../development/nim-packages/chroma { };
@ -19,6 +22,8 @@ lib.makeScope newScope (self:
jester = callPackage ../development/nim-packages/jester { };
jsonschema = callPackage ../development/nim-packages/jsonschema { };
karax = callPackage ../development/nim-packages/karax { };
markdown = callPackage ../development/nim-packages/markdown { };