Repository navigation
Expand file tree
/
Copy pathflake.nix
More file actions
56 lines (51 loc) · 1.45 KB
/
Copy pathflake.nix
File metadata and controls
56 lines (51 loc) · 1.45 KB
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
{
description = "Flake for developing zig-yaml";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11";
flake-utils.url = "github:numtide/flake-utils";
zig.url = "github:mitchellh/zig-overlay";
zls.url = "github:zigtools/zls";
poop.url = "github:kubkon/poop/nix";
# Used for shell.nix
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
};
outputs =
{
self,
nixpkgs,
flake-utils,
...
}@inputs:
let
# Our supported systems are the same supported systems as the Zig binaries
systems = builtins.attrNames inputs.zig.packages;
in
flake-utils.lib.eachSystem systems (
system:
let
pkgs = nixpkgs.legacyPackages.${system};
zig = inputs.zig.packages.${system}.master;
zls = inputs.zls.packages.${system}.default.overrideAttrs (old: {
nativeBuildInputs = [ zig ];
});
poop = inputs.poop.packages.${system}.default.overrideAttrs (old: {
nativeBuildInputs = [ zig ];
});
linuxSpecific = pkgs.lib.optionals pkgs.stdenv.isLinux [ poop ];
in
rec {
devShells.default = pkgs.mkShell {
name = "zig-yaml";
buildInputs = [
zig
zls
] ++ linuxSpecific;
};
# For compatibility with older versions of the `nix` binary
devShell = self.devShells.${system}.default;
}
);
}