From 79c77ab335a8651c95797e3f5823e0c4ce9600d3 Mon Sep 17 00:00:00 2001 From: Damien Cassou Date: Tue, 15 Oct 2024 13:32:25 +0200 Subject: [PATCH] copilot-node-server: init at 1.41.0 --- .../co/copilot-node-server/package-lock.json | 16 +++++++ .../co/copilot-node-server/package.nix | 42 +++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 pkgs/by-name/co/copilot-node-server/package-lock.json create mode 100644 pkgs/by-name/co/copilot-node-server/package.nix diff --git a/pkgs/by-name/co/copilot-node-server/package-lock.json b/pkgs/by-name/co/copilot-node-server/package-lock.json new file mode 100644 index 000000000000..deb2875f6a5b --- /dev/null +++ b/pkgs/by-name/co/copilot-node-server/package-lock.json @@ -0,0 +1,16 @@ +{ + "name": "copilot-node-server", + "version": "1.41.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "copilot-node-server", + "version": "1.41.0", + "license": "GitHub Terms of Service", + "bin": { + "copilot-node-server": "copilot/dist/language-server.js" + } + } + } +} diff --git a/pkgs/by-name/co/copilot-node-server/package.nix b/pkgs/by-name/co/copilot-node-server/package.nix new file mode 100644 index 000000000000..9dac4e80164b --- /dev/null +++ b/pkgs/by-name/co/copilot-node-server/package.nix @@ -0,0 +1,42 @@ +{ + lib, + buildNpmPackage, + fetchFromGitHub, +}: + +buildNpmPackage rec { + pname = "copilot-node-server"; + version = "1.41.0"; + + src = fetchFromGitHub { + owner = "jfcherng"; + repo = "copilot-node-server"; + rev = "v${version}"; + hash = "sha256-yOqA2Xo4c7u0g6RQYt9joQk8mI9KE0xTAnLjln9atmg="; + }; + + npmDepsHash = "sha256-tbcNRQBbJjN1N5ENxCvPQbfteyxTbPpi35dYmeUc4A4="; + + postPatch = '' + # Upstream doesn't provide any lock file so we provide our own: + cp ${./package-lock.json} package-lock.json + ''; + + preInstall = '' + # `npmInstallHook` requires a `node_modules/` folder but `npm + # install` doesn't generate one because the project has no + # dependencies: + mkdir node_modules/ + ''; + + forceEmptyCache = true; + dontNpmBuild = true; + + meta = with lib; { + description = "Copilot Node.js server"; + homepage = src.meta.homepage; + license = licenses.unfree; # I don't know: https://github.com/jfcherng/copilot-node-server/blob/main/LICENSE.md + maintainers = with maintainers; [ DamienCassou ]; + mainProgram = "copilot-node-server"; + }; +}