-
Notifications
You must be signed in to change notification settings - Fork 53
/
flake.nix
60 lines (57 loc) · 1.83 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-fetch Nix Flake";
inputs.nix-filter.url = "github:numtide/nix-filter";
inputs.flake-utils.url = "github:numtide/flake-utils";
inputs.nixpkgs = {
url = "github:nix-ocaml/nix-overlays";
inputs.flake-utils.follows = "flake-utils";
};
inputs.melange-src = {
url = "github:melange-re/melange";
inputs.nix-filter.follows = "nix-filter";
inputs.flake-utils.follows = "flake-utils";
inputs.nixpkgs.follows = "nixpkgs";
};
outputs = { self, nixpkgs, flake-utils, nix-filter, melange-src }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages."${system}".appendOverlays [
(self: super: {
ocamlPackages = super.ocaml-ng.ocamlPackages_5_1;
})
melange-src.overlays.default
];
inherit (pkgs) nodejs_latest lib stdenv darwin;
mkShell = { inputsFrom, buildInputs ? [ ] }: pkgs.mkShell {
nativeBuildInputs = with pkgs; [
yarn
nodejs_latest
] ++ (with pkgs.ocamlPackages; [
reason
ocamlformat
merlin
]);
inherit inputsFrom buildInputs;
};
in
rec {
packages = {
default = with pkgs.ocamlPackages; buildDunePackage {
pname = "melange-fetch";
version = "dev";
src = ./.;
nativeBuildInputs = with pkgs.ocamlPackages; [ melange ];
propagatedBuildInputs = with pkgs.ocamlPackages; [ melange ];
};
};
devShells = {
default = mkShell {
inputsFrom = [ packages.default ];
};
release = mkShell {
inputsFrom = [ packages.default ];
buildInputs = with pkgs; [ cacert curl ocamlPackages.dune-release git ];
};
};
});
}