1
0
Fork 0
nix-overlay/packages/lexical.nix
Daniel Kempkens 1a14f57e03
All checks were successful
Build / build-amd64-linux (push) Successful in 7m30s
Build / build-arm64-linux (push) Successful in 9m1s
lexical: fix
2023-11-13 22:53:03 +01:00

53 lines
1.5 KiB
Nix

{ pkgs, lib }:
let
erlang = pkgs.beam.interpreters.erlangR26;
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 {
pname = "lexical";
version = "0.4.1";
src = pkgs.fetchFromGitHub {
owner = "lexical-lsp";
repo = "lexical";
rev = "v${version}";
sha256 = "sha256-X9oXx7+BjsfzVpPwZeI9ezuwHGDyvrSx940LsR6Mw8A=";
};
mixFodDeps = beamPackages.fetchMixDeps {
pname = "mix-deps-${pname}";
inherit src version;
sha256 = "sha256-SQiXUjHmvtXUbHpPI1WSqsvPCauw+wiQmuwqUXOOscM=";
};
NAMESPACE = "1";
installPhase = ''
runHook preInstall
mix do compile --no-deps-check, package --path "$out"
runHook postInstall
'';
preFixup = ''
for script in $out/releases/*/elixir; do
substituteInPlace "$script" --replace 'ERL_EXEC="erl"' 'ERL_EXEC="${erlang}/bin/erl"'
done
chmod -x $out/bin/boot.exs
substituteInPlace $out/bin/start_lexical.sh --replace '! . "$script_dir"/activate_version_manager.sh' 'false'
makeWrapper $out/bin/start_lexical.sh $out/bin/lexical --set RELEASE_COOKIE lexical
'';
}