From fe207f1a0949e268128d0b876ea6de89304b9f41 Mon Sep 17 00:00:00 2001 From: dish Date: Wed, 5 Nov 2025 16:45:49 -0500 Subject: [PATCH] coc-smartf: migrate from nodePackages --- .../editors/vim/plugins/cocPlugins.nix | 6 ++ .../vim/plugins/nodePackagePlugins.nix | 1 - pkgs/by-name/co/coc-smartf/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-smartf/package.nix diff --git a/pkgs/applications/editors/vim/plugins/cocPlugins.nix b/pkgs/applications/editors/vim/plugins/cocPlugins.nix index 9da56238a7bc..f86ceb25dcf7 100644 --- a/pkgs/applications/editors/vim/plugins/cocPlugins.nix +++ b/pkgs/applications/editors/vim/plugins/cocPlugins.nix @@ -25,6 +25,7 @@ coc-r-lsp, coc-rust-analyzer, coc-sh, + coc-smartf, coc-spell-checker, coc-toml, }: @@ -156,6 +157,11 @@ final: prev: { src = "${coc-sh}/lib/node_modules/coc-sh"; }; + coc-smartf = buildVimPlugin { + inherit (coc-smartf) pname version meta; + src = "${coc-smartf}/lib/node_modules/coc-smartf"; + }; + 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 1d1d2ad11547..0156472f578a 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-smartf" "coc-snippets" "coc-solargraph" "coc-sqlfluff" diff --git a/pkgs/by-name/co/coc-smartf/package.nix b/pkgs/by-name/co/coc-smartf/package.nix new file mode 100644 index 000000000000..debc471d419f --- /dev/null +++ b/pkgs/by-name/co/coc-smartf/package.nix @@ -0,0 +1,71 @@ +{ + lib, + stdenvNoCC, + fetchFromGitHub, + fetchYarnDeps, + yarnConfigHook, + yarnBuildHook, + yarnInstallHook, + nodejs, + nix-update-script, + esbuild, + buildGoModule, +}: +let + esbuild' = + let + version = "0.12.22"; + in + esbuild.override { + buildGoModule = + args: + buildGoModule ( + args + // { + inherit version; + src = fetchFromGitHub { + owner = "evanw"; + repo = "esbuild"; + rev = "v${version}"; + hash = "sha256-vZlrHfcXOz4QHTH9otpwtPIWHGxK4TAol5o/Tl0M98E="; + }; + vendorHash = "sha256-2ABWPqhK2Cf4ipQH7XvRrd+ZscJhYPc3SV2cGT0apdg="; + } + ); + }; +in +stdenvNoCC.mkDerivation (finalAttrs: { + pname = "coc-smartf"; + version = "1.2.1"; + + src = fetchFromGitHub { + owner = "neoclide"; + repo = "coc-smartf"; + tag = finalAttrs.version; + hash = "sha256-CL0jWwMj6sFXEx+D1Orc4Fivbl33qE2P3yRJB0qqQFQ="; + }; + + yarnOfflineCache = fetchYarnDeps { + inherit (finalAttrs) src; + hash = "sha256-s1TStKyDPydBxMLfszhKHGyQeFIC6bDPtssNm9hdZNs="; + }; + + nativeBuildInputs = [ + yarnConfigHook + yarnBuildHook + yarnInstallHook + nodejs + esbuild' + ]; + + env.ESBUILD_BINARY_PATH = lib.getExe esbuild'; + + passthru.updateScript = nix-update-script { }; + + meta = { + description = "Make jump to character easier"; + homepage = "https://github.com/neoclide/coc-smartf"; + 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 a403908e46d1..9aad98a54adb 100644 --- a/pkgs/development/node-packages/aliases.nix +++ b/pkgs/development/node-packages/aliases.nix @@ -99,6 +99,7 @@ mapAliases { coc-rls = throw "coc-rls was removed because rls was deprecated in 2022. You should use coc-rust-analyzer instead, as rust-analyzer is maintained."; # added 2025-10-01 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-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 045fd70e00ec..09b34386277e 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-smartf" , "coc-snippets" , "coc-solargraph" , "coc-stylelint" diff --git a/pkgs/development/node-packages/node-packages.nix b/pkgs/development/node-packages/node-packages.nix index 99cb7ddb44bb..05bfffb84e8c 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-smartf = nodeEnv.buildNodePackage { - name = "coc-smartf"; - packageName = "coc-smartf"; - version = "1.2.1"; - src = fetchurl { - url = "https://registry.npmjs.org/coc-smartf/-/coc-smartf-1.2.1.tgz"; - sha512 = "Zlm+lt03V1qmJVvQw81svaWE+jC9e42VTnHBh8qjlUJUMG1GDjuC8cwM1ulamdovSsKdlmtHwVpScdKBgg3/Fg=="; - }; - buildInputs = globalBuildInputs; - meta = { - description = "Smart find extension for coc.nvim"; - homepage = "https://github.com/neoclide/coc-smartf#readme"; - license = "MIT"; - }; - production = true; - bypassCache = true; - reconstructLock = true; - }; coc-snippets = nodeEnv.buildNodePackage { name = "coc-snippets"; packageName = "coc-snippets";