-
Notifications
You must be signed in to change notification settings - Fork 1
/
flake.nix
60 lines (53 loc) · 1.82 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
{
# description = "Nix Flake";
inputs = {
nixpkgs.url = "github:nix-ocaml/nix-overlays/43b2cb2af722919d63cd8befd35b6ea68fdb9830";
flake-utils.url = "github:numtide/flake-utils";
nix-filter.url = "github:numtide/nix-filter";
ocaml-overlays.url = "github:nix-ocaml/nix-overlays/43b2cb2af722919d63cd8befd35b6ea68fdb9830";
ocaml-overlays.inputs = {
nixpkgs.follows = "nixpkgs";
flake-utils.follows = "flake-utils";
};
};
outputs = { self, nixpkgs, ocaml-overlays, nix-filter, flake-utils }:
let supportedSystems = [ "x86_64-linux" "aarch64-linux" "aarch64-darwin" ];
in with flake-utils.lib;
eachSystem supportedSystems (system:
let
pkgs = (ocaml-overlays.makePkgs {
inherit system;
extraOverlays = [ (import ./nix/overlay.nix) ];
}).extend
(self: super: { ocamlPackages = super.ocaml-ng.ocamlPackages_5_0; });
pkgs_static = pkgs.pkgsCross.musl64;
tzproxy_static = pkgs.callPackage ./nix {
pkgs = pkgs_static;
doCheck = true;
static = true;
inherit nix-filter;
};
tzproxy = pkgs.callPackage ./nix {
doCheck = true;
inherit nix-filter;
};
in {
devShell = import ./nix/shell.nix { inherit pkgs tzproxy; };
packages = {
inherit tzproxy tzproxy_static;
docker = import ./nix/docker.nix {
inherit pkgs;
tzproxy = tzproxy_static;
};
};
formatter = pkgs.callPackage ./nix/formatter.nix { };
}) // {
hydraJobs = {
x86_64-linux = self.packages.x86_64-linux;
aarch64-darwin = {
# darwin doesn't support static builds and docker
inherit (self.packages.aarch64-darwin) tzproxy;
};
};
};
}