biome: 1.9.2 -> 1.9.3
[NixPkgs.git] / pkgs / by-name / co / codeium / package.nix
blobdc8c9c2eea68f2d085d294abc1bacfe926205027
1 { stdenv, lib, fetchurl, gzip, autoPatchelfHook }:
2 let
4   inherit (stdenv.hostPlatform) system;
5   throwSystem = throw "Unsupported system: ${system}";
7   plat = {
8     x86_64-linux = "linux_x64";
9     aarch64-linux = "linux_arm";
10     x86_64-darwin = "macos_x64";
11     aarch64-darwin = "macos_arm";
13   }.${system} or throwSystem;
15   hash = {
16     x86_64-linux = "sha256-CQQ2GFy8eEaZkbnuCvBgSRMlwrEfqvM+dF1jlr6b7hk=";
17     aarch64-linux = "sha256-LGGZZmVVO1ZhKXfU1F9SC2pGEZOqbf/hxmBMex4ll1o=";
18     x86_64-darwin = "sha256-+pReEaZyi3o/ftaglOUNHoal9PShfj0gSJ2B3cg2Pa0=";
19     aarch64-darwin = "sha256-0l6YlL9CSypRCzbxTOpC9fx2blgu5uelYCo85koJUdA=";
20   }.${system} or throwSystem;
22   bin = "$out/bin/codeium_language_server";
25 stdenv.mkDerivation (finalAttrs: {
26   pname = "codeium";
27   version = "1.20.4";
28   src = fetchurl {
29     name = "${finalAttrs.pname}-${finalAttrs.version}.gz";
30     url = "https://github.com/Exafunction/codeium/releases/download/language-server-v${finalAttrs.version}/language_server_${plat}.gz";
31     inherit hash;
32   };
34   nativeBuildInputs = [ gzip ] ++ lib.optionals stdenv.hostPlatform.isLinux [ autoPatchelfHook ];
36   dontUnpack = true;
37   dontConfigure = true;
38   dontBuild = true;
40   installPhase = ''
41     runHook preInstall
42     mkdir -p $out/bin
43     gzip -dc $src > ${bin}
44     chmod +x ${bin}
45     runHook postInstall
46   '';
48   passthru.updateScript = ./update.sh;
50   meta = rec {
51     description = "Codeium language server";
52     longDescription = ''
53       Codeium proprietary language server, patched for Nix(OS) compatibility.
54       bin/language_server_x must be symlinked into the plugin directory, replacing the existing binary.
55       For example:
56       ```shell
57       ln -s "$(which codeium_language_server)" /home/a/.local/share/JetBrains/Rider2023.1/codeium/662505c9b23342478d971f66a530cd102ae35df7/language_server_linux_x64
58       ```
59     '';
60     homepage = "https://codeium.com/";
61     downloadPage = homepage;
62     changelog = homepage;
63     license = lib.licenses.unfree;
64     maintainers = with lib.maintainers; [ anpin ];
65     mainProgram = "codeium";
66     platforms = [ "aarch64-darwin" "aarch64-linux" "x86_64-linux" "x86_64-darwin" ];
67     sourceProvenance = [ lib.sourceTypes.binaryNativeCode ];
68   };