languages/kotlin: allow specifying a command for lsp.package, fix indentation

This commit is contained in:
diniamo 2024-10-27 12:54:39 +01:00
parent 30a8a8fce0
commit 5ab1af9285

View file

@ -8,7 +8,7 @@
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;
inherit (lib.types) package; inherit (lib.types) either package listOf str;
inherit (lib.nvim.types) mkGrammarOption diagnostics; inherit (lib.nvim.types) mkGrammarOption diagnostics;
inherit (lib.lists) isList; inherit (lib.lists) isList;
inherit (lib.nvim.lua) expToLua; inherit (lib.nvim.lua) expToLua;
@ -43,12 +43,12 @@ in {
package = mkOption { package = mkOption {
description = "kotlin_language_server package with Kotlin runtime"; description = "kotlin_language_server package with Kotlin runtime";
type = package; type = either package (listOf str);
example = literalExpression '' example = literalExpression ''
pkgs.symlinkJoin { pkgs.symlinkJoin {
name = "kotlin-language-server-wrapped"; name = "kotlin-language-server-wrapped";
paths = [pkgs.kotlin-language-server]; paths = [pkgs.kotlin-language-server];
nativeBuildInputs = [pkgs.makeWrapper]; nativeBuildInputs = [pkgs.makeBinaryWrapper];
postBuild = ''' postBuild = '''
wrapProgram $out/bin/kotlin-language-server \ wrapProgram $out/bin/kotlin-language-server \
--prefix PATH : ''${pkgs.kotlin}/bin --prefix PATH : ''${pkgs.kotlin}/bin