1{ stdenv, lib, fetchFromGitHub, zig }:
2
3stdenv.mkDerivation rec {
4 pname = "zls";
5 version = "0.10.0";
6
7 src = fetchFromGitHub {
8 owner = "zigtools";
9 repo = pname;
10 rev = version;
11 sha256 = "sha256-M0GG4KIMcHN+bEprUv6ISZkWNvWN12S9vqSKP+DRU9M=";
12 fetchSubmodules = true;
13 };
14
15 nativeBuildInputs = [ zig ];
16
17 dontConfigure = true;
18
19 preBuild = ''
20 export HOME=$TMPDIR
21 '';
22
23 installPhase = ''
24 runHook preInstall
25 zig build -Drelease-safe -Dcpu=baseline --prefix $out install
26 runHook postInstall
27 '';
28
29 meta = with lib; {
30 description = "Zig LSP implementation + Zig Language Server";
31 changelog = "https://github.com/zigtools/zls/releases/tag/${version}";
32 homepage = "https://github.com/zigtools/zls";
33 license = licenses.mit;
34 maintainers = with maintainers; [ fortuneteller2k ];
35 platforms = platforms.unix;
36 };
37}