-
-
Notifications
You must be signed in to change notification settings - Fork 52
/
flake.nix
60 lines (57 loc) · 1.87 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 = "Melange Nix Flake";
inputs = {
nix-filter.url = "github:numtide/nix-filter";
flake-utils.url = "github:numtide/flake-utils";
nixpkgs = {
url = "github:nix-ocaml/nix-overlays";
inputs.flake-utils.follows = "flake-utils";
};
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.flake-utils.follows = "flake-utils";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, flake-utils, nix-filter, melange-compiler-libs }:
{
overlays.default = import ./nix/overlay.nix {
nix-filter = nix-filter.lib;
melange-compiler-libs-vendor-dir = melange-compiler-libs;
};
} // (flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages."${system}".extend (self: super: {
ocamlPackages = super.ocaml-ng.ocamlPackages_5_3;
});
packages =
let
melange = pkgs.callPackage ./nix {
nix-filter = nix-filter.lib;
melange-compiler-libs-vendor-dir = melange-compiler-libs;
};
in
{
inherit melange;
default = melange;
melange-playground = pkgs.ocamlPackages.callPackage ./nix/melange-playground.nix {
inherit melange;
nix-filter = nix-filter.lib;
melange-compiler-libs-vendor-dir = melange-compiler-libs;
};
};
melange-shell = opts:
pkgs.callPackage ./nix/shell.nix ({ inherit packages; } // opts);
in
{
inherit packages;
devShells = {
default = melange-shell { };
release = melange-shell {
release-mode = true;
};
};
}));
}