From eaff6e79d4131635b4b1e500fc135b044c418cd3 Mon Sep 17 00:00:00 2001 From: Pyrox Date: Sun, 14 Jul 2024 14:14:01 -0400 Subject: [PATCH] coc-pyright: migrate from nodePackages --- .../editors/vim/plugins/overrides.nix | 8 ++++- pkgs/by-name/co/coc-pyright/package.nix | 27 +++++++++++++++++ pkgs/development/node-packages/aliases.nix | 1 + .../node-packages/node-packages.json | 1 - .../node-packages/node-packages.nix | 30 ------------------- 5 files changed, 35 insertions(+), 32 deletions(-) create mode 100644 pkgs/by-name/co/coc-pyright/package.nix diff --git a/pkgs/applications/editors/vim/plugins/overrides.nix b/pkgs/applications/editors/vim/plugins/overrides.nix index fe85fcf4b567a..6d313a17da444 100644 --- a/pkgs/applications/editors/vim/plugins/overrides.nix +++ b/pkgs/applications/editors/vim/plugins/overrides.nix @@ -18,6 +18,7 @@ arrow-cpp , Cocoa , coc-diagnostic +, coc-pyright , code-minimap , dasht , deno @@ -349,6 +350,12 @@ src = "${coc-diagnostic}/lib/node_modules/coc-diagnostic"; }; + coc-pyright = buildVimPlugin { + pname = "coc-pyright"; + inherit (coc-pyright) version meta; + src = "${coc-pyright}/lib/node_modules/coc-pyright"; + }; + coc-nginx = buildVimPlugin { pname = "coc-nginx"; inherit (nodePackages."@yaegassy/coc-nginx") version meta; @@ -2234,7 +2241,6 @@ "coc-metals" "coc-pairs" "coc-prettier" - "coc-pyright" "coc-python" "coc-r-lsp" "coc-rls" diff --git a/pkgs/by-name/co/coc-pyright/package.nix b/pkgs/by-name/co/coc-pyright/package.nix new file mode 100644 index 0000000000000..34bcf59b756dd --- /dev/null +++ b/pkgs/by-name/co/coc-pyright/package.nix @@ -0,0 +1,27 @@ +{ + lib, + buildNpmPackage, + fetchFromGitHub, +}: + +buildNpmPackage { + pname = "coc-pyright"; + version = "1.1.371"; + + src = fetchFromGitHub { + owner = "fannheyward"; + repo = "coc-pyright"; + # No tagged releases, this commit corresponds to the latest release of the package. + rev = "d4cfda2f530622962a2a6e3ac1ddb2ad83ea2387"; + hash = "sha256-oNixIW63DhPn2LYJ5t/R4xcReZR3W6nqqFBnCUmo/Wo="; + }; + + npmDepsHash = "sha256-cTAt02RdQbKurP6H/JWwVp+VpoIysbFt9le9R69+DL4="; + + meta = { + description = "Pyright extension for coc.nvim"; + homepage = "https://github.com/fannheyward/coc-pyright"; + 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 ba7301f63c5df..47ebb3c9aaa06 100644 --- a/pkgs/development/node-packages/aliases.nix +++ b/pkgs/development/node-packages/aliases.nix @@ -71,6 +71,7 @@ mapAliases { inherit (pkgs) clubhouse-cli; # added 2023-08-18 inherit (pkgs) coc-diagnostic; # added 2024-06-29 coc-imselect = throw "coc-imselect was removed because it was broken"; # added 2023-08-21 + inherit (pkgs) coc-pyright; # added 2024-07-14 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 1cdca49cd02f9..f0c66c4c7c99c 100644 --- a/pkgs/development/node-packages/node-packages.json +++ b/pkgs/development/node-packages/node-packages.json @@ -49,7 +49,6 @@ , "coc-metals" , "coc-pairs" , "coc-prettier" -, "coc-pyright" , "coc-python" , "coc-r-lsp" , "coc-rls" diff --git a/pkgs/development/node-packages/node-packages.nix b/pkgs/development/node-packages/node-packages.nix index 1a36b419534cf..17b5363ea8069 100644 --- a/pkgs/development/node-packages/node-packages.nix +++ b/pkgs/development/node-packages/node-packages.nix @@ -43875,15 +43875,6 @@ let sha512 = "pMpnA0qRdFp32b1sJl1wOJNxZLQ2cbQx+k6tjNtZ8CpvVhNqEPRgivZ2WOUev2YMajecdH7ctUPDvEe87nariQ=="; }; }; - "pyright-1.1.373" = { - name = "pyright"; - packageName = "pyright"; - version = "1.1.373"; - src = fetchurl { - url = "https://registry.npmjs.org/pyright/-/pyright-1.1.373.tgz"; - sha512 = "ZJSjqnHbeZowUnuAiojZqCLeY1XVzRIc2GvMFFNy/z6YSyJXwChPDQL5Jl2bavTvXNO0ITRmMBVvoKCRN7cc3g=="; - }; - }; "q-1.5.1" = { name = "q"; packageName = "q"; @@ -63416,27 +63407,6 @@ in bypassCache = true; reconstructLock = true; }; - coc-pyright = nodeEnv.buildNodePackage { - name = "coc-pyright"; - packageName = "coc-pyright"; - version = "1.1.371"; - src = fetchurl { - url = "https://registry.npmjs.org/coc-pyright/-/coc-pyright-1.1.371.tgz"; - sha512 = "8vgKSjuMVpylSoHIwdzP9edeHwmjUFY+ZyBkcLQMdyjdZtEc3+6OblXS0Dm5nXosjLY/ATc+w+38ITIssqm76g=="; - }; - dependencies = [ - sources."pyright-1.1.373" - ]; - buildInputs = globalBuildInputs; - meta = { - description = "Pyright extension for coc.nvim, static type checker for Python"; - homepage = "https://github.com/fannheyward/coc-pyright#readme"; - license = "MIT"; - }; - production = true; - bypassCache = true; - reconstructLock = true; - }; coc-python = nodeEnv.buildNodePackage { name = "coc-python"; packageName = "coc-python";