From 8ed93fcf04400f9deb7a9a42265b1659a5d0621e Mon Sep 17 00:00:00 2001 From: Soliprem Date: Thu, 10 Oct 2024 18:52:45 +0200 Subject: [PATCH 1/3] kotlin: using symlinkjoin better --- modules/plugins/languages/kotlin.nix | 5 ----- 1 file changed, 5 deletions(-) diff --git a/modules/plugins/languages/kotlin.nix b/modules/plugins/languages/kotlin.nix index dcb19a98..aafcea43 100644 --- a/modules/plugins/languages/kotlin.nix +++ b/modules/plugins/languages/kotlin.nix @@ -23,11 +23,6 @@ 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"]; From f10e356ee567b291661657986449960b9b80f6bb Mon Sep 17 00:00:00 2001 From: Soliprem Date: Thu, 10 Oct 2024 20:03:24 +0200 Subject: [PATCH 2/3] kotlin: moved wrapper to example --- modules/plugins/languages/kotlin.nix | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/modules/plugins/languages/kotlin.nix b/modules/plugins/languages/kotlin.nix index aafcea43..8e4136b6 100644 --- a/modules/plugins/languages/kotlin.nix +++ b/modules/plugins/languages/kotlin.nix @@ -4,7 +4,7 @@ lib, ... }: let - inherit (lib.options) mkEnableOption mkOption; + inherit (lib.options) mkEnableOption mkOption literalExpression; inherit (lib.modules) mkIf mkMerge; inherit (lib.meta) getExe; inherit (lib.nvim.languages) diagnosticsToLua; @@ -17,13 +17,6 @@ # 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 - ]; - }; defaultDiagnosticsProvider = ["ktlint"]; diagnosticsProviders = { @@ -54,7 +47,18 @@ in { package = mkOption { description = "kotlin_language_server package with Kotlin runtime"; type = package; - default = kotlinLspWithRuntime; + example = literalExpression '' + pkgs.symlinkJoin { + name = "Kotlin-LSP-Wrapped"; + paths = [pkgs.kotlin-language-server]; + nativeBuildInputs = [pkgs.makeWrapper]; + postBuild = ''' + wrapProgram $out/bin/kotlin-language-server \ + --prefix PATH : ${pkgs.lib.makeBinPath [pkgs.kotlin]} + '''; + }; + ''; + default = pkgs.kotlin-language-server; }; }; From 25989fd71a69e977c558cc81860022cf037296d1 Mon Sep 17 00:00:00 2001 From: Soliprem Date: Thu, 10 Oct 2024 20:11:00 +0200 Subject: [PATCH 3/3] kotlin: cleaning up and fixing docs render --- modules/plugins/languages/kotlin.nix | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/modules/plugins/languages/kotlin.nix b/modules/plugins/languages/kotlin.nix index 8e4136b6..5637b4f4 100644 --- a/modules/plugins/languages/kotlin.nix +++ b/modules/plugins/languages/kotlin.nix @@ -15,9 +15,6 @@ 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 - defaultDiagnosticsProvider = ["ktlint"]; diagnosticsProviders = { ktlint = { @@ -49,12 +46,12 @@ in { type = package; example = literalExpression '' pkgs.symlinkJoin { - name = "Kotlin-LSP-Wrapped"; + name = "kotlin-language-server-wrapped"; paths = [pkgs.kotlin-language-server]; nativeBuildInputs = [pkgs.makeWrapper]; postBuild = ''' wrapProgram $out/bin/kotlin-language-server \ - --prefix PATH : ${pkgs.lib.makeBinPath [pkgs.kotlin]} + --prefix PATH : ''${pkgs.kotlin}/bin '''; }; '';