1
0
Fork 0
nix-overlay/packages/lexical.nix
Daniel Kempkens ccac626326
Some checks failed
Build / build-amd64-linux (push) Failing after 14m1s
Build / build-arm64-linux (push) Successful in 59m6s
lexical: use beam_nox
2024-04-15 21:56:05 +02:00

49 lines
1.2 KiB
Nix

{ pkgs, lib }:
let
erlang = pkgs.beam_nox.interpreters.erlangR26;
beamPackages = pkgs.beam.packagesWith erlang;
in
beamPackages.mixRelease rec {
pname = "lexical";
version = "0.5.2";
src = pkgs.fetchFromGitHub {
owner = "lexical-lsp";
repo = "lexical";
rev = "v${version}";
hash = "sha256-HWqwJ7PAz80bm6YeDG84hLWPE11n06K98GOyeDQWZWU=";
};
mixFodDeps = beamPackages.fetchMixDeps {
pname = "mix-deps-${pname}";
inherit src version;
sha256 = "sha256-oxR56mzV0uRs40j5N+bU1QDMXTYnJ789cUoOG462KtI=";
};
NAMESPACE = "1";
installPhase = ''
runHook preInstall
mix do compile --no-deps-check, package --path "$out"
runHook postInstall
'';
preFixup =
let
activate_version_manager = pkgs.writeScript "activate_version_manager.sh" ''
true
'';
in
''
substituteInPlace "$out/bin/start_lexical.sh" --replace 'elixir_command=' 'elixir_command="${beamPackages.elixir}/bin/"'
rm "$out/bin/activate_version_manager.sh"
ln -s ${activate_version_manager} "$out/bin/activate_version_manager.sh"
mv "$out/bin" "$out/binsh"
makeWrapper "$out/binsh/start_lexical.sh" "$out/bin/lexical" --set RELEASE_COOKIE lexical
'';
}