-
-
Notifications
You must be signed in to change notification settings - Fork 52
/
Copy pathflake.nix
74 lines (68 loc) · 2.05 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
{
description = "Melange Nix Flake";
inputs = {
nixpkgs.url = "github:nix-ocaml/nix-overlays";
melange-compiler-libs = {
# this changes rarely, and it's better than having to rely on nix's poor
# support for submodules
url = "github:melange-re/melange-compiler-libs";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, melange-compiler-libs }:
let
forAllSystems = f: nixpkgs.lib.genAttrs nixpkgs.lib.systems.flakeExposed (system:
let
pkgs = nixpkgs.legacyPackages.${system}.extend (self: super: {
ocamlPackages = super.ocaml-ng.ocamlPackages_5_3;
});
in
f pkgs);
in
{
overlays.default = import ./nix/overlay.nix {
melange-compiler-libs-vendor-dir = melange-compiler-libs;
};
packages = forAllSystems (pkgs:
let
melange = pkgs.callPackage ./nix {
melange-compiler-libs-vendor-dir = melange-compiler-libs;
};
in
{
inherit melange;
default = melange;
melange-playground = pkgs.ocamlPackages.callPackage ./nix/melange-playground.nix {
inherit melange;
melange-compiler-libs-vendor-dir = melange-compiler-libs;
};
}
);
devShells = forAllSystems (pkgs:
let
melange-shell = opts:
pkgs.callPackage ./nix/shell.nix ({
packages = self.packages.${pkgs.system};
} // opts);
in
{
default = melange-shell { };
release = melange-shell {
release-mode = true;
};
}
);
checks = nixpkgs.lib.genAttrs nixpkgs.lib.systems.flakeExposed (system:
let
pkgs = nixpkgs.legacyPackages.${system}.extend (self: super: {
ocamlPackages = super.ocaml-ng.ocamlPackages_5_3;
});
in
{
melange-check = pkgs.callPackage ./nix/ci/test.nix {
packages = self.packages.${pkgs.system};
};
}
);
};
}