1
0
Fork 0

lexical: use flake
All checks were successful
Build / build-amd64-linux (push) Successful in 1m53s
Build / build-arm64-linux (push) Successful in 7m3s

This commit is contained in:
Daniel Kempkens 2024-02-21 15:21:38 +01:00
parent ba532ee7e3
commit a3e4fc16ca
Signed by: daniel
SSH key fingerprint: SHA256:Ks/MyhQYcPRQiwMKLAKquWCdCPe3JXlb1WttgnAoSeM
2 changed files with 3 additions and 53 deletions

View file

@ -41,7 +41,7 @@
discord-downloader-go = import ./packages/discord-downloader-go.nix { inherit pkgs lib; }; discord-downloader-go = import ./packages/discord-downloader-go.nix { inherit pkgs lib; };
fennel-ls = import ./packages/fennel-ls.nix { inherit pkgs lib; }; fennel-ls = import ./packages/fennel-ls.nix { inherit pkgs lib; };
headscale-ui = import ./packages/headscale-ui.nix { inherit pkgs lib; }; headscale-ui = import ./packages/headscale-ui.nix { inherit pkgs lib; };
lexical = import ./packages/lexical.nix { inherit pkgs lib; }; lexical = import ./packages/lexical.nix { inherit system; };
neovim-nightly = import ./packages/neovim-nightly.nix { inherit (inputs'.neovim-flake.packages) neovim; inherit pkgs lib; }; neovim-nightly = import ./packages/neovim-nightly.nix { inherit (inputs'.neovim-flake.packages) neovim; inherit pkgs lib; };
q = import ./packages/q.nix { inherit pkgs lib; }; q = import ./packages/q.nix { inherit pkgs lib; };
redlib = import ./packages/redlib.nix { inherit pkgs lib; }; redlib = import ./packages/redlib.nix { inherit pkgs lib; };

View file

@ -1,53 +1,3 @@
{ pkgs, lib }: { system, ... }:
let (builtins.getFlake "github:lexical-lsp/lexical/a028a549e22f036d413334a42b67c9bb3cbdd13c").packages.${system}.default
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
'';
}