-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
82 lines (71 loc) · 1.68 KB
/
flake.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
{
description = "Zlib compiled with Zig";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs";
systems.url = "github:nix-systems/default-linux";
flake-utils.url = "github:numtide/flake-utils";
zig = {
url = "github:ziglang/zig?ref=pull/20511/head";
flake = false;
};
};
outputs =
{
self,
nixpkgs,
systems,
flake-utils,
...
}@inputs:
let
inherit (nixpkgs) lib;
defaultOverlay =
pkgs: prev: with pkgs; {
zig =
(prev.zig.overrideAttrs (
finalAttrs: p: {
version = "0.14.0-git+${inputs.zig.shortRev or "dirty"}";
src = inputs.zig;
doInstallCheck = false;
postBuild = "";
postInstall = "";
outputs = [ "out" ];
}
)).override
{
llvmPackages = llvmPackages_19;
};
zlib-zig = stdenv.mkDerivation {
pname = "zlib-zig";
version = self.shortRev or "dirty";
src = lib.cleanSource self;
nativeBuildInputs = [
pkgs.zig
];
};
};
in
flake-utils.lib.eachSystem (import systems) (
system:
let
pkgs = nixpkgs.legacyPackages.${system}.appendOverlays [
defaultOverlay
];
in
{
packages = {
default = pkgs.zlib-zig;
};
devShells = {
default = pkgs.zlib-zig;
};
legacyPackages = pkgs;
}
)
// {
overlays = {
default = defaultOverlay;
dart-zig = defaultOverlay;
};
};
}