1
0
Fork 0
nix-overlay/packages/lexical.nix

51 lines
1.3 KiB
Nix
Raw Normal View History

2023-08-08 23:25:34 +00:00
{ pkgs, lib }:
let
2023-08-24 19:17:31 +00:00
erlang = pkgs.beam.interpreters.erlangR26;
2023-08-08 23:25:34 +00:00
beamPackagesPrev = pkgs.beam.packagesWith erlang;
elixir = beamPackagesPrev.elixir_1_15;
beamPackages = beamPackagesPrev // rec {
inherit erlang elixir;
hex = beamPackagesPrev.hex.override { inherit elixir; };
buildMix = beamPackagesPrev.buildMix.override { inherit elixir erlang hex; };
mixRelease = beamPackagesPrev.mixRelease.override { inherit erlang elixir; };
fetchMixDeps = beamPackagesPrev.fetchMixDeps.override { inherit elixir; };
};
in
beamPackages.mixRelease rec {
2023-08-09 00:10:16 +00:00
pname = "lexical";
2023-11-13 20:18:37 +00:00
version = "0.4.1";
2023-08-08 23:25:34 +00:00
src = pkgs.fetchFromGitHub {
owner = "lexical-lsp";
repo = "lexical";
2023-08-24 19:17:31 +00:00
rev = "v${version}";
2023-11-13 20:18:37 +00:00
sha256 = "sha256-X9oXx7+BjsfzVpPwZeI9ezuwHGDyvrSx940LsR6Mw8A=";
2023-08-08 23:25:34 +00:00
};
mixFodDeps = beamPackages.fetchMixDeps {
pname = "mix-deps-${pname}";
inherit src version;
2023-10-24 21:24:48 +00:00
sha256 = "sha256-SQiXUjHmvtXUbHpPI1WSqsvPCauw+wiQmuwqUXOOscM=";
2023-08-08 23:25:34 +00:00
};
NAMESPACE = "1";
installPhase = ''
runHook preInstall
2023-08-24 19:17:31 +00:00
mix do compile --no-deps-check, package --path "$out"
2023-08-08 23:25:34 +00:00
2023-08-09 00:10:16 +00:00
runHook postInstall
'';
2023-08-08 23:25:34 +00:00
2023-08-09 00:10:16 +00:00
preFixup = ''
for script in $out/releases/*/elixir; do
substituteInPlace "$script" --replace 'ERL_EXEC="erl"' 'ERL_EXEC="${erlang}/bin/erl"'
done
2023-08-08 23:25:34 +00:00
2023-08-24 19:17:31 +00:00
makeWrapper $out/bin/start_lexical.sh $out/bin/lexical --set RELEASE_COOKIE lexical
2023-08-08 23:25:34 +00:00
'';
}