1 { lib, elixir, fetchFromGitHub, fetchMixDeps, mixRelease, nix-update-script }:
2 # Based on the work of Hauleth
3 # None of this would have happened without him
8 src = fetchFromGitHub {
12 hash = "sha256-LUAYfR6MNNGLaqv8EBx0JQ8KYYD7jRvez3HJFnczV+Y=";
13 fetchSubmodules = true;
17 inherit pname version src elixir;
21 mixFodDeps = fetchMixDeps {
22 pname = "mix-deps-${pname}";
23 inherit src version elixir;
24 hash = "sha256-MVGYENy6/xI/ph/X0DxquigCuLK1FAEIONzoQU7TXoM=";
27 # elixir-ls is an umbrella app
28 # override configurePhase to not skip umbrella children
31 mix deps.compile --no-deps-check
35 # elixir-ls require a special step for release
36 # compile and release need to be performed together because
37 # of the no-deps-check requirement
40 mix do compile --no-deps-check, elixir_ls.release
47 cp -Rv release $out/lib
48 # Prepare the wrapper script
49 substitute release/language_server.sh $out/bin/elixir-ls \
50 --replace 'exec "''${dir}/launch.sh"' "exec $out/lib/launch.sh"
51 chmod +x $out/bin/elixir-ls
53 substitute release/debugger.sh $out/bin/elixir-debugger \
54 --replace 'exec "''${dir}/launch.sh"' "exec $out/lib/launch.sh"
55 chmod +x $out/bin/elixir-debugger
56 # prepare the launcher
57 substituteInPlace $out/lib/launch.sh \
58 --replace "ERL_LIBS=\"\$SCRIPTPATH:\$ERL_LIBS\"" \
59 "ERL_LIBS=$out/lib:\$ERL_LIBS" \
60 --replace "exec elixir" "exec ${elixir}/bin/elixir"
65 homepage = "https://github.com/elixir-lsp/elixir-ls";
67 A frontend-independent IDE "smartness" server for Elixir.
68 Implements the "Language Server Protocol" standard and provides debugger support via the "Debug Adapter Protocol"
71 The Elixir Language Server provides a server that runs in the background, providing IDEs, editors, and other tools with information about Elixir Mix projects.
72 It adheres to the Language Server Protocol, a standard for frontend-independent IDE support.
73 Debugger integration is accomplished through the similar VS Code Debug Protocol.
75 license = licenses.asl20;
76 platforms = platforms.unix;
77 mainProgram = "elixir-ls";
78 maintainers = teams.beam.members;
80 passthru.updateScript = nix-update-script { };