0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-14 06:00:33 +03:00

copilot-language-server: add fhs version (#393260)

This commit is contained in:
Mirza Arnaut 2025-04-04 18:58:21 +02:00 committed by GitHub
parent fdcba6e9d5
commit 249b8edca0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 26 additions and 5 deletions

View file

@ -1,6 +1,7 @@
{
lib,
stdenvNoCC,
buildFHSEnv,
fetchzip,
nix-update-script,
}:
@ -24,8 +25,24 @@ let
}
."${stdenvNoCC.hostPlatform.system}"
or (throw "Unsupported system: ${stdenvNoCC.hostPlatform.system}");
in
executableName = "copilot-language-server";
fhs =
{ package }:
buildFHSEnv {
name = package.meta.mainProgram;
version = package.version;
targetPkgs = pkgs: [ pkgs.stdenv.cc.cc.lib ];
runScript = lib.getExe package;
meta = package.meta // {
description =
package.meta.description
+ " (FHS-wrapped, expand package details for further information when to use it)";
longDescription = "Use this version if you encounter an error like `Could not start dynamically linked executable` or `SyntaxError: Invalid or unexpected token` (see nixpkgs issue [391730](https://github.com/NixOS/nixpkgs/issues/391730)).";
};
};
in
stdenvNoCC.mkDerivation (finalAttrs: {
pname = "copilot-language-server";
version = "1.294.0";
@ -36,18 +53,20 @@ stdenvNoCC.mkDerivation (finalAttrs: {
stripRoot = false;
};
npmDepsHash = "sha256-PLX/mN7xu8gMh2BkkyTncP3+rJ3nBmX+pHxl0ONXbe4=";
installPhase = ''
runHook preInstall
install -Dt "$out"/bin "${os}-${arch}"/copilot-language-server
install "${os}-${arch}/${executableName}" -Dm755 -t "$out"/bin
runHook postInstall
'';
dontStrip = true;
passthru.updateScript = nix-update-script { };
passthru = {
updateScript = nix-update-script { };
fhs = fhs { package = finalAttrs.finalPackage; };
};
meta = {
description = "Use GitHub Copilot with any editor or IDE via the Language Server Protocol";
@ -60,7 +79,7 @@ stdenvNoCC.mkDerivation (finalAttrs: {
shortName = "GitHub Copilot License";
url = "https://github.com/customer-terms/github-copilot-product-specific-terms";
};
mainProgram = "copilot-language-server";
mainProgram = executableName;
platforms = [
"x86_64-linux"
"aarch64-linux"

View file

@ -359,6 +359,8 @@ with pkgs;
coolercontrol = recurseIntoAttrs (callPackage ../applications/system/coolercontrol { });
copilot-language-server-fhs = copilot-language-server.fhs;
curv = callPackage ../by-name/cu/curv/package.nix {
openexr = openexr_3;
};