-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshell.nix
54 lines (52 loc) · 1.32 KB
/
shell.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
{
pkgs ? import <nixpkgs> { },
system ? builtins.currentSystem,
}:
let
zig =
let
version = "master-2025-02-05";
in
(import (pkgs.fetchFromGitHub {
owner = "mitchellh";
repo = "zig-overlay";
rev = "4dfa3d690edb7ae4cb332229b68dcf1ef30a1a03";
sha256 = "sha256-pIWjN75ZMDQmj77GiT8yV3U3pFpQsv9An+xnK+UxhMI=";
}) { inherit pkgs system; })."${version}";
zls =
let
# Please find a matching ZLS version on https://zigtools.org/zls/install/
# whenever the above Zig version is changed.
version = "0.14.0-dev.390+188a4c0";
systems = {
x86_64-linux = "sha256-1q4WEfSHaIp9q6xtq+jNO0QHN22vE1e1bbH4OYzQlvI=";
};
sha256 = systems.${system};
splits = pkgs.lib.strings.splitString "-" system;
arch = builtins.elemAt splits 0;
os = builtins.elemAt splits 1;
in
pkgs.stdenv.mkDerivation {
pname = "zls";
inherit version;
src = pkgs.fetchurl {
url = "https://builds.zigtools.org/zls-${os}-${arch}-${version}.tar.xz";
inherit sha256;
};
sourceRoot = ".";
dontConfigure = true;
dontBuild = true;
dontFixup = true;
installPhase = ''
mkdir -p $out/bin
cp zls $out/bin/zls
'';
};
in
pkgs.mkShellNoCC {
packages = [
zig
zls
pkgs.lldb
];
}