forked from nix-community/zon2nix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
59 lines (50 loc) · 1.26 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
{
description = "zon2nix helps you package Zig project with Nix, by converting the dependencies in a build.zig.zon to a Nix expression.";
inputs = {
flake-parts = {
url = "github:hercules-ci/flake-parts";
inputs.nixpkgs-lib.follows = "nixpkgs";
};
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
};
outputs = inputs@{ flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
systems = [
"aarch64-darwin"
"aarch64-linux"
"x86_64-darwin"
"x86_64-linux"
];
flake.herculesCI.ciSystems = [
"aarch64-linux"
"x86_64-linux"
];
perSystem = { lib, pkgs, ... }:
let
zig = pkgs.zig_0_12;
inherit (lib)
getExe
;
inherit (pkgs)
nix
stdenv
;
in
{
packages.default = stdenv.mkDerivation {
pname = "zon2nix";
version = "0.1.2";
src = ./.;
nativeBuildInputs = [
zig.hook
];
zigBuildFlags = [
"-Dnix=${getExe nix}"
];
zigCheckFlags = [
"-Dnix=${getExe nix}"
];
};
};
};
}