-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathflake.nix
47 lines (44 loc) · 1.35 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
{
inputs = {
opam-nix.url = "github:tweag/opam-nix";
flake-utils.url = "github:numtide/flake-utils";
nixpkgs.follows = "opam-nix/nixpkgs";
};
outputs = { self, flake-utils, opam-nix, nixpkgs }@inputs:
let package = "cpspg";
in flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
on = opam-nix.lib.${system};
scope =
on.buildOpamProject { } package ./. { ocaml-system = "*"; };
overlay = final: prev:
{
# Your overrides go here
};
in rec {
legacyPackages = scope.overrideScope overlay;
packages = rec {
default = self.legacyPackages.${system}.${package};
cpspg = default;
};
devShells.default = with pkgs; pkgs.mkShell {
buildInputs = [
# Source file formatting
nixpkgs-fmt
ocamlformat
# For `dune build --watch ...`
fswatch
# For `dune build @doc`
ocamlPackages.odoc
# OCaml editor support
ocamlPackages.ocaml-lsp
# Nicely formatted types on hover
ocamlPackages.ocamlformat-rpc-lib
# Fancy REPL thing
ocamlPackages.utop
legacyPackages.cpspg
];
};
});
}