From a3e4fc16caadd24120c3024abe856f7c4a53ebdf Mon Sep 17 00:00:00 2001 From: Daniel Kempkens Date: Wed, 21 Feb 2024 15:21:38 +0100 Subject: [PATCH] lexical: use flake --- flake.nix | 2 +- packages/lexical.nix | 54 ++------------------------------------------ 2 files changed, 3 insertions(+), 53 deletions(-) diff --git a/flake.nix b/flake.nix index 6532c15..8f8fdde 100644 --- a/flake.nix +++ b/flake.nix @@ -41,7 +41,7 @@ discord-downloader-go = import ./packages/discord-downloader-go.nix { inherit pkgs lib; }; fennel-ls = import ./packages/fennel-ls.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; }; q = import ./packages/q.nix { inherit pkgs lib; }; redlib = import ./packages/redlib.nix { inherit pkgs lib; }; diff --git a/packages/lexical.nix b/packages/lexical.nix index e502aed..57cdaa6 100644 --- a/packages/lexical.nix +++ b/packages/lexical.nix @@ -1,53 +1,3 @@ -{ pkgs, lib }: +{ system, ... }: -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 - ''; -} +(builtins.getFlake "github:lexical-lsp/lexical/a028a549e22f036d413334a42b67c9bb3cbdd13c").packages.${system}.default