Compare commits

..

3 commits

Author SHA1 Message Date
Soliprem
25989fd71a kotlin: cleaning up and fixing docs render 2024-10-10 20:11:00 +02:00
Soliprem
f10e356ee5 kotlin: moved wrapper to example 2024-10-10 20:03:24 +02:00
Soliprem
8ed93fcf04 kotlin: using symlinkjoin better 2024-10-10 18:52:45 +02:00

View file

@ -4,7 +4,7 @@
lib, lib,
... ...
}: let }: let
inherit (lib.options) mkEnableOption mkOption; inherit (lib.options) mkEnableOption mkOption literalExpression;
inherit (lib.modules) mkIf mkMerge; inherit (lib.modules) mkIf mkMerge;
inherit (lib.meta) getExe; inherit (lib.meta) getExe;
inherit (lib.nvim.languages) diagnosticsToLua; inherit (lib.nvim.languages) diagnosticsToLua;
@ -15,21 +15,6 @@
cfg = config.vim.languages.kotlin; cfg = config.vim.languages.kotlin;
# Creating a version of the LSP with access to the kotlin binary.
# This is necessary for the LSP to load the standard library
kotlinLspWithRuntime = pkgs.symlinkJoin {
name = "kotlin-language-server-with-runtime";
paths = [
pkgs.kotlin-language-server
pkgs.kotlin
];
buildInputs = [pkgs.makeWrapper];
postBuild = ''
wrapProgram $out/bin/kotlin-language-server \
--prefix PATH : ${pkgs.lib.makeBinPath [pkgs.kotlin]}
'';
};
defaultDiagnosticsProvider = ["ktlint"]; defaultDiagnosticsProvider = ["ktlint"];
diagnosticsProviders = { diagnosticsProviders = {
ktlint = { ktlint = {
@ -59,7 +44,18 @@ in {
package = mkOption { package = mkOption {
description = "kotlin_language_server package with Kotlin runtime"; description = "kotlin_language_server package with Kotlin runtime";
type = package; type = package;
default = kotlinLspWithRuntime; example = literalExpression ''
pkgs.symlinkJoin {
name = "kotlin-language-server-wrapped";
paths = [pkgs.kotlin-language-server];
nativeBuildInputs = [pkgs.makeWrapper];
postBuild = '''
wrapProgram $out/bin/kotlin-language-server \
--prefix PATH : ''${pkgs.kotlin}/bin
''';
};
'';
default = pkgs.kotlin-language-server;
}; };
}; };