push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,92 @@
{
stdenv,
lib,
fetchurl,
gzip,
autoPatchelfHook,
versionCheckHook,
}:
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-noZVrLvkiHP2H3+zWlgqRpKIFxdQzhjl/2XjRpuVYhs=";
aarch64-linux = "sha256-bznlEnBZqF3Vfkt8y9XCgQ5O0yxzlGw9HAoByblZ2A4=";
x86_64-darwin = "sha256-LIbFX5WUlWw+wF3Sj+v+2zDn2xzvDlW8AO/TJsvDa6c=";
aarch64-darwin = "sha256-ANS9FFwrgmRhknpNija9DhO2Znj/RAJhq2GUMZiau6o=";
}
.${system} or throwSystem;
bin = "$out/bin/codeium_language_server";
in
stdenv.mkDerivation (finalAttrs: {
pname = "codeium";
version = "1.46.3";
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.hostPlatform.isLinux [ autoPatchelfHook ];
dontUnpack = true;
dontConfigure = true;
dontBuild = true;
installPhase = ''
runHook preInstall
mkdir -p $out/bin
gzip -dc $src > ${bin}
chmod +x ${bin}
runHook postInstall
'';
nativeInstallCheckInputs = [
versionCheckHook
];
versionCheckProgram = "${placeholder "out"}/bin/codeium_language_server";
versionCheckProgramArg = "--version";
doInstallCheck = true;
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_language_server";
platforms = [
"aarch64-darwin"
"aarch64-linux"
"x86_64-linux"
"x86_64-darwin"
];
sourceProvenance = [ lib.sourceTypes.binaryNativeCode ];
};
})

View File

@@ -0,0 +1,35 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p curl gnused gawk nix-prefetch jq
set -euo pipefail
ROOT="$(dirname "$(readlink -f "$0")")"
NIX_DRV="$ROOT/package.nix"
if [ ! -f "$NIX_DRV" ]; then
echo "ERROR: cannot find package.nix in $ROOT"
exit 1
fi
fetch_arch() {
VER="$1"; ARCH="$2"
URL="https://github.com/Exafunction/codeium/releases/download/language-server-v${VER}/language_server_${ARCH}.gz"
nix-hash --to-sri --type sha256 "$(nix-prefetch-url --type sha256 "$URL")"
}
replace_hash() {
sed -i "s#$1 = \"sha256-.\{44\}\"#$1 = \"$2\"#" "$NIX_DRV"
}
CODEIUM_VER=$(curl -s "https://api.github.com/repos/Exafunction/codeium/releases/latest" | jq -r .tag_name | grep -oP '\d+\.\d+\.\d+' )
CODEIUM_LINUX_X64_HASH=$(fetch_arch "$CODEIUM_VER" "linux_x64")
CODEIUM_LINUX_AARCH64_HASH=$(fetch_arch "$CODEIUM_VER" "linux_arm")
CODEIUM_DARWIN_X64_HASH=$(fetch_arch "$CODEIUM_VER" "macos_x64")
CODEIUM_DARWIN_AARCH64_HASH=$(fetch_arch "$CODEIUM_VER" "macos_arm")
sed -i "s/version = \".*\"/version = \"$CODEIUM_VER\"/" "$NIX_DRV"
replace_hash "x86_64-linux" "$CODEIUM_LINUX_X64_HASH"
replace_hash "aarch64-linux" "$CODEIUM_LINUX_AARCH64_HASH"
replace_hash "x86_64-darwin" "$CODEIUM_DARWIN_X64_HASH"
replace_hash "aarch64-darwin" "$CODEIUM_DARWIN_AARCH64_HASH"