Skip to content

Commit 9272d3d

Browse files
committed
switch from mitchellh/zig-overlay to silversquirl/zig-flake
1 parent e0ae13c commit 9272d3d

File tree

3 files changed

+30
-129
lines changed

3 files changed

+30
-129
lines changed

deps.nix

Lines changed: 0 additions & 27 deletions
This file was deleted.

flake.lock

Lines changed: 9 additions & 60 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 21 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -2,54 +2,33 @@
22
inputs = {
33
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05";
44

5-
zig-overlay.url = "github:mitchellh/zig-overlay";
6-
zig-overlay.inputs.nixpkgs.follows = "nixpkgs";
5+
zig.url = "github:silversquirl/zig-flake";
6+
zig.inputs.nixpkgs.follows = "nixpkgs";
77

88
gitignore.url = "github:hercules-ci/gitignore.nix";
99
gitignore.inputs.nixpkgs.follows = "nixpkgs";
1010
};
1111

1212
outputs = {
13-
self,
1413
nixpkgs,
15-
zig-overlay,
14+
zig,
1615
gitignore,
17-
}:
18-
builtins.foldl' nixpkgs.lib.recursiveUpdate {} (
19-
builtins.map
20-
(
21-
system: let
22-
pkgs = nixpkgs.legacyPackages.${system};
23-
zig = zig-overlay.packages.${system}."0.15.1";
24-
gitignoreSource = gitignore.lib.gitignoreSource;
25-
target = builtins.replaceStrings ["darwin"] ["macos"] system;
26-
revision = self;
27-
in {
28-
formatter.${system} = pkgs.alejandra;
29-
packages.${system} = rec {
30-
default = zls;
31-
zls = pkgs.stdenvNoCC.mkDerivation {
32-
name = "zls";
33-
version = "master";
34-
meta.mainProgram = "zls";
35-
src = gitignoreSource ./.;
36-
nativeBuildInputs = [zig];
37-
dontInstall = true;
38-
doCheck = true;
39-
configurePhase = ''
40-
export ZIG_GLOBAL_CACHE_DIR=$TEMP/.cache
41-
'';
42-
buildPhase = ''
43-
PACKAGE_DIR=${pkgs.callPackage ./deps.nix {}}
44-
zig build install --system $PACKAGE_DIR -Dtarget=${target} -Doptimize=ReleaseSafe --color off --prefix $out
45-
'';
46-
checkPhase = ''
47-
zig build test --system $PACKAGE_DIR -Dtarget=${target} --color off
48-
'';
49-
};
50-
};
51-
}
52-
)
53-
["x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin"]
54-
);
16+
...
17+
}: let
18+
forAllSystems = f: builtins.mapAttrs f nixpkgs.legacyPackages;
19+
in {
20+
formatter = forAllSystems (system: pkgs: pkgs.alejandra);
21+
22+
packages = forAllSystems (system: pkgs: {
23+
default = zig.packages.${system}.zig_0_15_1.makePackage {
24+
pname = "zls";
25+
version = "0.15.1";
26+
meta.mainProgram = "zls";
27+
src = gitignore.lib.gitignoreSource ./.;
28+
doCheck = true;
29+
zigReleaseMode = "safe";
30+
depsHash = "sha256-ji4qpx3WEEIaW8/Ps5uNJHvMEA+tl6wWj3dZx0RWQpo=";
31+
};
32+
});
33+
};
5534
}

0 commit comments

Comments
 (0)