about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--pkgs/development/tools/language-servers/zls/default.nix40
-rw-r--r--pkgs/top-level/all-packages.nix4
2 files changed, 21 insertions, 23 deletions
diff --git a/pkgs/development/tools/language-servers/zls/default.nix b/pkgs/development/tools/language-servers/zls/default.nix
index ef96258354b2..65f39381c8ca 100644
--- a/pkgs/development/tools/language-servers/zls/default.nix
+++ b/pkgs/development/tools/language-servers/zls/default.nix
@@ -1,37 +1,33 @@
-{ stdenv, lib, fetchFromGitHub, zig }:
+{ lib
+, stdenv
+, fetchFromGitHub
+, zigHook
+}:
 
-stdenv.mkDerivation rec {
+stdenv.mkDerivation (finalAttrs: {
   pname = "zls";
   version = "0.10.0";
 
   src = fetchFromGitHub {
     owner = "zigtools";
-    repo = pname;
-    rev = version;
-    sha256 = "sha256-M0GG4KIMcHN+bEprUv6ISZkWNvWN12S9vqSKP+DRU9M=";
+    repo = "zls";
+    rev = finalAttrs.version;
     fetchSubmodules = true;
+    hash = "sha256-M0GG4KIMcHN+bEprUv6ISZkWNvWN12S9vqSKP+DRU9M=";
   };
 
-  nativeBuildInputs = [ zig ];
+  nativeBuildInputs = [
+    zigHook
+  ];
 
   dontConfigure = true;
 
-  preBuild = ''
-    export HOME=$TMPDIR
-  '';
-
-  installPhase = ''
-    runHook preInstall
-    zig build -Drelease-safe -Dcpu=baseline --prefix $out install
-    runHook postInstall
-  '';
-
-  meta = with lib; {
+  meta = {
     description = "Zig LSP implementation + Zig Language Server";
-    changelog = "https://github.com/zigtools/zls/releases/tag/${version}";
+    changelog = "https://github.com/zigtools/zls/releases/tag/${finalAttrs.version}";
     homepage = "https://github.com/zigtools/zls";
-    license = licenses.mit;
-    maintainers = with maintainers; [ fortuneteller2k ];
-    platforms = platforms.unix;
+    license = lib.licenses.mit;
+    maintainers = with lib.maintainers; [ fortuneteller2k ];
+    platforms = lib.platforms.unix;
   };
-}
+})
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index b3e5114b826e..047c829d962a 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -18269,7 +18269,9 @@ with pkgs;
   vscode-langservers-extracted = callPackage ../development/tools/language-servers/vscode-langservers-extracted { };
 
   zls = callPackage ../development/tools/language-servers/zls {
-    zig = buildPackages.zig_0_10;
+    zigHook = zigHook.override {
+      zig = buildPackages.zig_0_10;
+    };
   };
 
   ansible-later = callPackage ../tools/admin/ansible/later.nix { };