-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathflake.nix
66 lines (62 loc) · 1.84 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
{
description = "stellogen";
inputs = {
# Remark: when adding inputs here, don't forget to also add them in the
# arguments to `outputs` below!
flake-utils.url = "github:numtide/flake-utils";
nixpkgs.url = "nixpkgs/nixos-unstable";
};
# Remark: keep the list of outputs in sync with the list of inputs above
# (see above remark)
outputs = { self, flake-utils, nixpkgs}:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
ocamlPackages = pkgs.ocamlPackages;
easy_logging = ocamlPackages.buildDunePackage rec {
pname = "easy_logging";
version = "0.8.2";
src = pkgs.fetchFromGitHub {
owner = "sapristi";
repo = "easy_logging";
rev = "v${version}";
sha256 = "sha256-Xy6Rfef7r2K8DTok7AYa/9m3ZEV07LlUeMQSRayLBco=";
};
buildInputs = [ ocamlPackages.calendar ];
};
stellogen = ocamlPackages.buildDunePackage {
pname = "stellogen";
version = "0.1.0";
duneVersion = "3";
src = ./.;
OCAMLPARAM = "_,warn-error=+A"; # Turn all warnings into errors.
propagatedBuildInputs = [
easy_logging
] ++ (with ocamlPackages; [
calendar
alcotest
base
menhir
]);
};
in
{
packages = {
inherit stellogen;
default = stellogen;
};
devShells.default = pkgs.mkShell {
packages = [
pkgs.ocamlPackages.ocaml
pkgs.ocamlPackages.ocamlformat
pkgs.ocamlPackages.menhir
pkgs.ocamlPackages.odoc
pkgs.ocamlPackages.ocaml-lsp
pkgs.jq
];
inputsFrom = [
self.packages.${system}.stellogen
];
};
});
}