From 63bccd4eaba04ce8dbb51baf68c476f947f73c26 Mon Sep 17 00:00:00 2001 From: dish Date: Wed, 5 Nov 2025 16:46:38 -0500 Subject: [PATCH] coc-snippets: migrate from nodePackages --- .../editors/vim/plugins/cocPlugins.nix | 6 ++++ .../vim/plugins/nodePackagePlugins.nix | 1 - pkgs/by-name/co/coc-snippets/package.nix | 31 +++++++++++++++++++ pkgs/development/node-packages/aliases.nix | 1 + .../node-packages/node-packages.json | 1 - .../node-packages/node-packages.nix | 18 ----------- 6 files changed, 38 insertions(+), 20 deletions(-) create mode 100644 pkgs/by-name/co/coc-snippets/package.nix diff --git a/pkgs/applications/editors/vim/plugins/cocPlugins.nix b/pkgs/applications/editors/vim/plugins/cocPlugins.nix index f86ceb25dcf7..5b4c054f068f 100644 --- a/pkgs/applications/editors/vim/plugins/cocPlugins.nix +++ b/pkgs/applications/editors/vim/plugins/cocPlugins.nix @@ -26,6 +26,7 @@ coc-rust-analyzer, coc-sh, coc-smartf, + coc-snippets, coc-spell-checker, coc-toml, }: @@ -162,6 +163,11 @@ final: prev: { src = "${coc-smartf}/lib/node_modules/coc-smartf"; }; + coc-snippets = buildVimPlugin { + inherit (coc-snippets) pname version meta; + src = "${coc-snippets}/lib/node_modules/coc-snippets"; + }; + coc-spell-checker = buildVimPlugin { pname = "coc-spell-checker"; inherit (coc-spell-checker) version meta; diff --git a/pkgs/applications/editors/vim/plugins/nodePackagePlugins.nix b/pkgs/applications/editors/vim/plugins/nodePackagePlugins.nix index 0156472f578a..71ce5e823b7e 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-snippets" "coc-solargraph" "coc-sqlfluff" "coc-stylelint" diff --git a/pkgs/by-name/co/coc-snippets/package.nix b/pkgs/by-name/co/coc-snippets/package.nix new file mode 100644 index 000000000000..68a13262d155 --- /dev/null +++ b/pkgs/by-name/co/coc-snippets/package.nix @@ -0,0 +1,31 @@ +{ + lib, + buildNpmPackage, + fetchFromGitHub, + nix-update-script, +}: + +buildNpmPackage (finalAttrs: { + pname = "coc-snippets"; + version = "3.4.7"; + + src = fetchFromGitHub { + owner = "neoclide"; + repo = "coc-snippets"; + tag = finalAttrs.version; + hash = "sha256-xaExEsNy6uuYUTeyXaon4DAoRIF6OpIZis59oetR36c="; + }; + + npmDepsHash = "sha256-tRyFtfL3Jc+uajELVdJoDteY3lnq0Bx8UQTaz2HtbW0="; + + npmBuildScript = "prepare"; + + passthru.updateScript = nix-update-script { }; + + meta = { + description = "Snippets solution for coc.nvim"; + homepage = "https://github.com/neoclide/coc-snippets"; + 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 9aad98a54adb..5b12e45fcd40 100644 --- a/pkgs/development/node-packages/aliases.nix +++ b/pkgs/development/node-packages/aliases.nix @@ -100,6 +100,7 @@ mapAliases { inherit (pkgs) coc-rust-analyzer; # added 2025-11-05 inherit (pkgs) coc-sh; # added 2025-10-02 inherit (pkgs) coc-smartf; # Added 2025-11-05 + inherit (pkgs) coc-snippets; # Added 2025-11-05 inherit (pkgs) coc-spell-checker; # added 2025-10-01 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 diff --git a/pkgs/development/node-packages/node-packages.json b/pkgs/development/node-packages/node-packages.json index 09b34386277e..8c45daf5160e 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-snippets" , "coc-solargraph" , "coc-stylelint" , "coc-sumneko-lua" diff --git a/pkgs/development/node-packages/node-packages.nix b/pkgs/development/node-packages/node-packages.nix index 05bfffb84e8c..73da382cfc1d 100644 --- a/pkgs/development/node-packages/node-packages.nix +++ b/pkgs/development/node-packages/node-packages.nix @@ -37659,24 +37659,6 @@ in bypassCache = true; reconstructLock = true; }; - coc-snippets = nodeEnv.buildNodePackage { - name = "coc-snippets"; - packageName = "coc-snippets"; - version = "3.4.0"; - src = fetchurl { - url = "https://registry.npmjs.org/coc-snippets/-/coc-snippets-3.4.0.tgz"; - sha512 = "p7nxP/ii+iRADnvFEuHz4iDhuspg3W08hj4J0IFz/OYrzJwEON3c+5i0DJEXyr8qrt0c2Vd+3rekRE8J2AhwGQ=="; - }; - buildInputs = globalBuildInputs; - meta = { - description = "Snippets extension for coc.nvim"; - homepage = "https://github.com/neoclide/coc-snippets#readme"; - license = "MIT"; - }; - production = true; - bypassCache = true; - reconstructLock = true; - }; coc-solargraph = nodeEnv.buildNodePackage { name = "coc-solargraph"; packageName = "coc-solargraph";