-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathflake.nix
33 lines (33 loc) · 1.02 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
{
inputs = {
opam-nix.url = "github:tweag/opam-nix";
flake-utils.url = "github:numtide/flake-utils";
opam-nix.inputs.nixpkgs.follows = "nixpkgs";
# maintain a different opam-repository to those pinned upstream
opam-repository = {
url = "github:ocaml/opam-repository";
flake = false;
};
opam-nix.inputs.opam-repository.follows = "opam-repository";
};
outputs = { self, flake-utils, opam-nix, nixpkgs, ... }@inputs:
flake-utils.lib.eachDefaultSystem (system:
let
package = "wol";
pkgs = nixpkgs.legacyPackages.${system};
on = opam-nix.lib.${system};
devPackagesQuery = {
ocaml-lsp-server = "*";
ocamlformat = "*";
# 1.9.6 fails to build
ocamlfind = "1.9.5";
utop = "*";
};
query = { ocaml-base-compiler = "*"; };
scope = on.buildOpamProject' { } ./. (query // devPackagesQuery);
in rec {
packages = scope;
defaultPackage = packages.${package};
}
);
}