1 { stdenv, lib, coursier, jre, makeWrapper, setJavaClassPath }:
3 stdenv.mkDerivation rec {
7 deps = stdenv.mkDerivation {
8 name = "${pname}-deps-${version}";
10 export COURSIER_CACHE=$(pwd)
11 ${coursier}/bin/cs fetch org.scalameta:metals_2.13:${version} \
12 -r bintray:scalacenter/releases \
13 -r sonatype:snapshots > deps
14 mkdir -p $out/share/java
15 cp -n $(< deps) $out/share/java/
17 outputHashMode = "recursive";
18 outputHashAlgo = "sha256";
19 outputHash = "sha256-CJ34OZOAM0Le9U0KSe0nKINnxA3iUgqUMtS06YnjvVo=";
22 nativeBuildInputs = [ makeWrapper setJavaClassPath ];
23 buildInputs = [ deps ];
27 extraJavaOpts = "-XX:+UseG1GC -XX:+UseStringDeduplication -Xss4m -Xms100m";
32 makeWrapper ${jre}/bin/java $out/bin/metals \
33 --add-flags "${extraJavaOpts} -cp $CLASSPATH scala.meta.metals.Main"
37 homepage = "https://scalameta.org/metals/";
38 license = licenses.asl20;
39 description = "Work-in-progress language server for Scala";
40 maintainers = with maintainers; [ fabianhjr tomahna ];