lol

vimPlugins.codeium-nvim: use the correct version of codeium

authored by

Gaetan Lepage and committed by
Matthieu Coudron
93fdb2d0 718bd06c

+63 -2
+63 -2
pkgs/applications/editors/vim/plugins/overrides.nix
··· 315 315 src = "${nodePackages."@yaegassy/coc-nginx"}/lib/node_modules/@yaegassy/coc-nginx"; 316 316 }; 317 317 318 - codeium-nvim = super.codeium-nvim.overrideAttrs { 318 + codeium-nvim = let 319 + # Update according to https://github.com/Exafunction/codeium.nvim/blob/main/lua/codeium/versions.json 320 + codeiumVersion = "1.6.7"; 321 + codeiumHashes = { 322 + x86_64-linux = "sha256-z1cZ6xmP25iPezeLpz4xRh7czgx1JLwsYwGAEUA6//I="; 323 + aarch64-linux = "sha256-8cSdCiIVbqv91lUMOLV1Xld8KuIzJA5HCIDbhyyc404="; 324 + x86_64-darwin = "sha256-pjW7tNyO0cIFdIm69H6I3HDBpFwnJIRmIN7WRi1OfLw="; 325 + aarch64-darwin = "sha256-DgE4EVNCM9+YdTVJeVYnrDGAXOJV1VrepiVeX3ziwfg="; 326 + }; 327 + 328 + codeium' = codeium.overrideAttrs rec { 329 + version = codeiumVersion; 330 + 331 + src = let 332 + inherit (stdenv.hostPlatform) system; 333 + throwSystem = throw "Unsupported system: ${system}"; 334 + 335 + platform = { 336 + x86_64-linux = "linux_x64"; 337 + aarch64-linux = "linux_arm"; 338 + x86_64-darwin = "macos_x64"; 339 + aarch64-darwin = "macos_arm"; 340 + }.${system} or throwSystem; 341 + 342 + hash = codeiumHashes.${system} or throwSystem; 343 + in fetchurl { 344 + name = "codeium-${version}.gz"; 345 + url = "https://github.com/Exafunction/codeium/releases/download/language-server-v${version}/language_server_${platform}.gz"; 346 + inherit hash; 347 + }; 348 + }; 349 + 350 + in super.codeium-nvim.overrideAttrs { 319 351 dependencies = with self; [ nvim-cmp plenary-nvim ]; 320 352 buildPhase = '' 321 353 cat << EOF > lua/codeium/installation_defaults.lua 322 354 return { 323 355 tools = { 324 - language_server = "${codeium}/bin/codeium_language_server" 356 + language_server = "${codeium'}/bin/codeium_language_server" 325 357 }; 326 358 }; 327 359 EOF 360 + ''; 361 + 362 + doCheck = true; 363 + checkInputs = [ jq ]; 364 + checkPhase = '' 365 + runHook preCheck 366 + 367 + expected_codeium_version=$(jq -r '.version' lua/codeium/versions.json) 368 + actual_codeium_version=$(${codeium'}/bin/codeium_language_server --version) 369 + 370 + expected_codeium_stamp=$(jq -r '.stamp' lua/codeium/versions.json) 371 + actual_codeium_stamp=$(${codeium'}/bin/codeium_language_server --stamp | grep STABLE_BUILD_SCM_REVISION | cut -d' ' -f2) 372 + 373 + if [ "$actual_codeium_stamp" != "$expected_codeium_stamp" ]; then 374 + echo " 375 + The version of codeium patched in vimPlugins.codeium-nvim is incorrect. 376 + Expected stamp: $expected_codeium_stamp 377 + Actual stamp: $actual_codeium_stamp 378 + 379 + Expected codeium version: $expected_codeium_version 380 + Actual codeium version: $actual_codeium_version 381 + 382 + Please, update 'codeiumVersion' in pkgs/applications/editors/vim/plugins/overrides.nix accordingly to: 383 + https://github.com/Exafunction/codeium.nvim/blob/main/lua/codeium/versions.json 384 + " 385 + exit 1 386 + fi 387 + 388 + runHook postCheck 328 389 ''; 329 390 }; 330 391