From 012cccc12929b5119061236f9551c64cfe6d4764 Mon Sep 17 00:00:00 2001 From: dish Date: Wed, 5 Nov 2025 17:05:40 -0500 Subject: [PATCH] coc-texlab: migrate from nodePackages --- .../editors/vim/plugins/cocPlugins.nix | 6 ++ .../vim/plugins/nodePackagePlugins.nix | 1 - pkgs/by-name/co/coc-texlab/package.nix | 71 +++++++++++++++++++ pkgs/development/node-packages/aliases.nix | 1 + .../node-packages/node-packages.json | 1 - .../node-packages/node-packages.nix | 18 ----- 6 files changed, 78 insertions(+), 20 deletions(-) create mode 100644 pkgs/by-name/co/coc-texlab/package.nix diff --git a/pkgs/applications/editors/vim/plugins/cocPlugins.nix b/pkgs/applications/editors/vim/plugins/cocPlugins.nix index d630a1d62e87..9d5eaeda0c5a 100644 --- a/pkgs/applications/editors/vim/plugins/cocPlugins.nix +++ b/pkgs/applications/editors/vim/plugins/cocPlugins.nix @@ -33,6 +33,7 @@ coc-stylelint, coc-sumneko-lua, coc-tabnine, + coc-texlab, coc-toml, }: final: prev: { @@ -204,6 +205,11 @@ final: prev: { src = "${coc-tabnine}/lib/node_modules/coc-tabnine"; }; + coc-texlab = buildVimPlugin { + inherit (coc-texlab) pname version meta; + src = "${coc-texlab}/lib/node_modules/coc-texlab"; + }; + coc-toml = buildVimPlugin { pname = "coc-toml"; inherit (coc-toml) version meta; diff --git a/pkgs/applications/editors/vim/plugins/nodePackagePlugins.nix b/pkgs/applications/editors/vim/plugins/nodePackagePlugins.nix index a9a5d509b32e..ca4c0ca0e078 100644 --- a/pkgs/applications/editors/vim/plugins/nodePackagePlugins.nix +++ b/pkgs/applications/editors/vim/plugins/nodePackagePlugins.nix @@ -8,7 +8,6 @@ let nodePackageNames = [ "coc-go" "coc-ltex" - "coc-texlab" "coc-tsserver" "coc-ultisnips" "coc-vimlsp" diff --git a/pkgs/by-name/co/coc-texlab/package.nix b/pkgs/by-name/co/coc-texlab/package.nix new file mode 100644 index 000000000000..c260c3059447 --- /dev/null +++ b/pkgs/by-name/co/coc-texlab/package.nix @@ -0,0 +1,71 @@ +{ + lib, + stdenvNoCC, + fetchFromGitHub, + fetchYarnDeps, + yarnConfigHook, + yarnBuildHook, + yarnInstallHook, + nodejs, + nix-update-script, + esbuild, + buildGoModule, +}: +let + esbuild' = + let + version = "0.25.0"; + in + esbuild.override { + buildGoModule = + args: + buildGoModule ( + args + // { + inherit version; + src = fetchFromGitHub { + owner = "evanw"; + repo = "esbuild"; + rev = "v${version}"; + hash = "sha256-L9jm94Epb22hYsU3hoq1lZXb5aFVD4FC4x2qNt0DljA="; + }; + vendorHash = "sha256-+BfxCyg0KkDQpHt/wycy/8CTG6YBA/VJvJFhhzUnSiQ="; + } + ); + }; +in +stdenvNoCC.mkDerivation (finalAttrs: { + pname = "coc-texlab"; + version = "0-unstable-2025-07-22"; + + src = fetchFromGitHub { + owner = "fannheyward"; + repo = "coc-texlab"; + rev = "a4ad3f259d94086f4971b22b97833e8a72226782"; + hash = "sha256-6W+L/LdF6g0Xwhv+9VtjjfzRjlbN7OaqHbSXtO3cfZ0="; + }; + + yarnOfflineCache = fetchYarnDeps { + inherit (finalAttrs) src; + hash = "sha256-g2IwfO1IMktTtflR2m7c99wOYLJYmD2I7hBbCNy+XFA="; + }; + + nativeBuildInputs = [ + yarnConfigHook + yarnBuildHook + yarnInstallHook + nodejs + esbuild' + ]; + + env.ESBUILD_BINARY_PATH = lib.getExe esbuild'; + + passthru.updateScript = nix-update-script { extraArgs = [ "--version=branch" ]; }; + + meta = { + description = "TexLab extension for coc.nvim"; + homepage = "https://github.com/fannheyward/coc-texlab"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ pyrox0 ]; + }; +}) diff --git a/pkgs/development/node-packages/aliases.nix b/pkgs/development/node-packages/aliases.nix index c532259e4be3..a8836c6e736b 100644 --- a/pkgs/development/node-packages/aliases.nix +++ b/pkgs/development/node-packages/aliases.nix @@ -107,6 +107,7 @@ mapAliases { inherit (pkgs) coc-stylelint; # Added 2025-11-05 inherit (pkgs) coc-sumneko-lua; # Added 2025-11-05 inherit (pkgs) coc-tabnine; # Added 2025-11-05 + inherit (pkgs) coc-texlab; # Added 2025-11-05 inherit (pkgs) coc-toml; coc-tslint = throw "coc-tslint was removed because it was deprecated upstream; coc-eslint offers comparable features for eslint, which replaced tslint"; # Added 2024-10-18 coc-tslint-plugin = throw "coc-tslint-plugin was removed because it was deprecated upstream; coc-eslint offers comparable features for eslint, which replaced tslint"; # Added 2024-10-18 diff --git a/pkgs/development/node-packages/node-packages.json b/pkgs/development/node-packages/node-packages.json index 038642848fbc..849d9940a8b0 100644 --- a/pkgs/development/node-packages/node-packages.json +++ b/pkgs/development/node-packages/node-packages.json @@ -23,7 +23,6 @@ , "clipboard-cli" , "coc-go" , "coc-ltex" -, "coc-texlab" , "coc-tsserver" , "coc-ultisnips" , "coc-vimlsp" diff --git a/pkgs/development/node-packages/node-packages.nix b/pkgs/development/node-packages/node-packages.nix index 4427f16a7a5c..c4263ac3e230 100644 --- a/pkgs/development/node-packages/node-packages.nix +++ b/pkgs/development/node-packages/node-packages.nix @@ -37038,24 +37038,6 @@ in bypassCache = true; reconstructLock = true; }; - coc-texlab = nodeEnv.buildNodePackage { - name = "coc-texlab"; - packageName = "coc-texlab"; - version = "3.3.0"; - src = fetchurl { - url = "https://registry.npmjs.org/coc-texlab/-/coc-texlab-3.3.0.tgz"; - sha512 = "MV/zLxI6jvu/IWS3/dyc8Dsgz9ypO86hSAHwjRbDGTc/V9t8jTPUnI4E1hzmsF8bfIjxnUU/oyITX9tLTOnCOQ=="; - }; - buildInputs = globalBuildInputs; - meta = { - description = "TexLab extension for coc.nvim"; - homepage = "https://github.com/fannheyward/coc-texlab#readme"; - license = "MIT"; - }; - production = true; - bypassCache = true; - reconstructLock = true; - }; coc-tsserver = nodeEnv.buildNodePackage { name = "coc-tsserver"; packageName = "coc-tsserver";