From ee22f9dea6d8def0942d53f01a7ec52b823ba6f4 Mon Sep 17 00:00:00 2001 From: dish Date: Wed, 5 Nov 2025 17:07:40 -0500 Subject: [PATCH] coc-wxml: migrate from nodePackages --- .../editors/vim/plugins/cocPlugins.nix | 6 +++ .../vim/plugins/nodePackagePlugins.nix | 1 - pkgs/by-name/co/coc-wxml/package.nix | 51 +++++++++++++++++++ pkgs/development/node-packages/aliases.nix | 1 + .../node-packages/node-packages.json | 1 - .../node-packages/node-packages.nix | 17 ------- 6 files changed, 58 insertions(+), 19 deletions(-) create mode 100644 pkgs/by-name/co/coc-wxml/package.nix diff --git a/pkgs/applications/editors/vim/plugins/cocPlugins.nix b/pkgs/applications/editors/vim/plugins/cocPlugins.nix index 9eb604983b05..b0251e64be7a 100644 --- a/pkgs/applications/editors/vim/plugins/cocPlugins.nix +++ b/pkgs/applications/editors/vim/plugins/cocPlugins.nix @@ -37,6 +37,7 @@ coc-toml, coc-vimlsp, coc-vimtex, + coc-wxml, }: final: prev: { coc-basedpyright = buildVimPlugin { @@ -227,4 +228,9 @@ final: prev: { inherit (coc-vimtex) pname version meta; src = "${coc-vimtex}/lib/node_modules/coc-vimtex"; }; + + coc-wxml = buildVimPlugin { + inherit (coc-wxml) pname version meta; + src = "${coc-wxml}/lib/node_modules/coc-wxml"; + }; } diff --git a/pkgs/applications/editors/vim/plugins/nodePackagePlugins.nix b/pkgs/applications/editors/vim/plugins/nodePackagePlugins.nix index 83626979088c..70913d977a9f 100644 --- a/pkgs/applications/editors/vim/plugins/nodePackagePlugins.nix +++ b/pkgs/applications/editors/vim/plugins/nodePackagePlugins.nix @@ -10,7 +10,6 @@ let "coc-ltex" "coc-tsserver" "coc-ultisnips" - "coc-wxml" "coc-yaml" "coc-yank" "coc-nginx" diff --git a/pkgs/by-name/co/coc-wxml/package.nix b/pkgs/by-name/co/coc-wxml/package.nix new file mode 100644 index 000000000000..1bcea339cc24 --- /dev/null +++ b/pkgs/by-name/co/coc-wxml/package.nix @@ -0,0 +1,51 @@ +{ + lib, + stdenvNoCC, + fetchFromGitHub, + fetchYarnDeps, + yarnConfigHook, + yarnBuildHook, + yarnInstallHook, + nodejs, + nix-update-script, +}: +stdenvNoCC.mkDerivation (finalAttrs: { + pname = "coc-wxml"; + version = "1.0.9"; + + src = fetchFromGitHub { + owner = "neoclide"; + repo = "coc-wxml"; + tag = finalAttrs.version; + hash = "sha256-6tI+rIgoKGafBSxbPumCquAahJVR3rUzJB4VWQR+qw0="; + }; + + # Fix yarn.lock file + postPatch = '' + substituteInPlace yarn.lock \ + --replace-fail "http://registry.npmjs.org" "https://registry.yarnpkg.com" + ''; + + yarnOfflineCache = fetchYarnDeps { + inherit (finalAttrs) src postPatch; + hash = "sha256-s2doN+DeVJPIWe/vOuAH7cYl/S/v8S4yeTG6KIWKphA="; + }; + + nativeBuildInputs = [ + yarnConfigHook + yarnBuildHook + yarnInstallHook + nodejs + ]; + + NODE_OPTIONS = "--openssl-legacy-provider"; + + passthru.updateScript = nix-update-script { }; + + meta = { + description = "Wxml extension for coc.nvim"; + homepage = "https://github.com/neoclide/coc-wxml"; + 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 2228b84fc4eb..f69e51c467b1 100644 --- a/pkgs/development/node-packages/aliases.nix +++ b/pkgs/development/node-packages/aliases.nix @@ -114,6 +114,7 @@ mapAliases { coc-vetur = throw "coc-vetur was removed because vetur was deprecated by Vue in favor of volar. Use coc-volar instead, which supports Vue 3"; # added 2025-10-01 inherit (pkgs) coc-vimlsp; # Added 2025-11-05 inherit (pkgs) coc-vimtex; # Added 2025-11-05 + inherit (pkgs) coc-wxml; # Added 2025-11-05 coinmon = throw "coinmon was removed since it was abandoned upstream"; # added 2024-03-19 coffee-script = pkgs.coffeescript; # added 2023-08-18 inherit (pkgs) concurrently; # added 2024-08-05 diff --git a/pkgs/development/node-packages/node-packages.json b/pkgs/development/node-packages/node-packages.json index 28d9555265ef..92369bd45f56 100644 --- a/pkgs/development/node-packages/node-packages.json +++ b/pkgs/development/node-packages/node-packages.json @@ -25,7 +25,6 @@ , "coc-ltex" , "coc-tsserver" , "coc-ultisnips" -, "coc-wxml" , "coc-yaml" , "coc-yank" , "code-theme-converter" diff --git a/pkgs/development/node-packages/node-packages.nix b/pkgs/development/node-packages/node-packages.nix index 98d41a763087..904e59a24b41 100644 --- a/pkgs/development/node-packages/node-packages.nix +++ b/pkgs/development/node-packages/node-packages.nix @@ -37077,23 +37077,6 @@ in bypassCache = true; reconstructLock = true; }; - coc-wxml = nodeEnv.buildNodePackage { - name = "coc-wxml"; - packageName = "coc-wxml"; - version = "1.0.9"; - src = fetchurl { - url = "https://registry.npmjs.org/coc-wxml/-/coc-wxml-1.0.9.tgz"; - sha512 = "ExbBjO4/7sbwHVawtK/sDzFwmUTwW9rHgm51sJxqQim+Zjn3vw1x0pNObonVb+r/kX9peLCyE6/nmT2ybfeBPg=="; - }; - buildInputs = globalBuildInputs; - meta = { - description = "wxml language server extension for coc.nvim"; - license = "MIT"; - }; - production = true; - bypassCache = true; - reconstructLock = true; - }; coc-yaml = nodeEnv.buildNodePackage { name = "coc-yaml"; packageName = "coc-yaml";