blob: 923d4fce8f2184a82bcea7deb3ed5ea368b8cb1d (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
{ stdenv, lib, fetchurl, gzip, autoPatchelfHook }:
let
inherit (stdenv.hostPlatform) system;
throwSystem = throw "Unsupported system: ${system}";
plat = {
x86_64-linux = "linux_x64";
aarch64-linux = "linux_arm";
x86_64-darwin = "macos_x64";
aarch64-darwin = "macos_arm";
}.${system} or throwSystem;
hash = {
x86_64-linux = "sha256-9r3v5xCYYoxfs3zY7/v8K3B5CxJPcNcEtkDU6kuvzGE=";
aarch64-linux = "sha256-Q/PktmEfTBX1ycK/7ebsJSE25FQ8dO+ejv+fAOKlNy8=";
x86_64-darwin = "sha256-vyv5oyMl9Itu434okNmgRX0A1UTX3ZxJ3Q56akpIbrU=";
aarch64-darwin = "sha256-H2ghAfRzDhbCyxrKmJ2ritkUuDeWZzINr8DROzbOyUQ=";
}.${system} or throwSystem;
bin = "$out/bin/codeium_language_server";
in
stdenv.mkDerivation (finalAttrs: {
pname = "codeium";
version = "1.8.16";
src = fetchurl {
name = "${finalAttrs.pname}-${finalAttrs.version}.gz";
url = "https://github.com/Exafunction/codeium/releases/download/language-server-v${finalAttrs.version}/language_server_${plat}.gz";
inherit hash;
};
nativeBuildInputs = [ gzip ] ++ lib.optionals stdenv.isLinux [ autoPatchelfHook ];
dontUnpack = true;
dontConfigure = true;
dontBuild = true;
installPhase = ''
runHook preInstall
mkdir -p $out/bin
gzip -dc $src > ${bin}
chmod +x ${bin}
runHook postInstall
'';
passthru.updateScript = ./update.sh;
meta = rec {
description = "Codeium language server";
longDescription = ''
Codeium proprietary language server, patched for Nix(OS) compatibility.
bin/language_server_x must be symlinked into the plugin directory, replacing the existing binary.
For example:
```shell
ln -s "$(which codeium_language_server)" /home/a/.local/share/JetBrains/Rider2023.1/codeium/662505c9b23342478d971f66a530cd102ae35df7/language_server_linux_x64
```
'';
homepage = "https://codeium.com/";
downloadPage = homepage;
changelog = homepage;
license = lib.licenses.unfree;
maintainers = with lib.maintainers; [ anpin ];
mainProgram = "codeium";
platforms = [ "aarch64-darwin" "aarch64-linux" "x86_64-linux" "x86_64-darwin" ];
sourceProvenance = [ lib.sourceTypes.binaryNativeCode ];
};
})
|