-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
94 lines (81 loc) · 2.13 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
{
description = "serde-ml/toml: TOML suppport for serde.ml";
outputs = inputs @ {
self,
nixpkgs,
treefmt,
nix-filter,
flake-parts,
...
}:
flake-parts.lib.mkFlake {inherit inputs;} {
systems = ["x86_64-linux" "aarch64-linux" "aarch64-darwin" "x86_64-darwin"];
perSystem = {
l,
pkgs,
config,
...
}: let
op = pkgs.ocamlPackages;
filter = nix-filter.lib;
in {
packages.default = config.packages.serde_toml;
packages.serde_toml = op.buildDunePackage {
pname = "serde_toml";
version = "dev-${self.lastModifiedDate}";
duneVersion = "3";
src = filter {
root = ./.;
include = [
"lib"
"test"
./dune-project
];
};
propagatedBuildInputs = l.attrValues {
inherit (op) serde rio;
};
checkInputs = l.attrValues {
inherit (op) spices qcheck serde_derive;
};
};
devShells.default = pkgs.mkShell {
inputsFrom = [config.packages.default];
packages = l.attrValues {
inherit (op) ocaml-lsp ocamlformat;
};
};
treefmt.config = {
projectRootFile = ./dune-project;
flakeFormatter = true;
programs.alejandra.enable = true;
programs.ocamlformat = {
enable = true;
configFile = ./.ocamlformat;
};
};
};
imports = [
{
perSystem = {
lib,
system,
...
}: {
_module.args.pkgs = import nixpkgs {
inherit system;
overlays = [(import ./nix/ocaml.overlay.nix)];
};
_module.args.l = lib // builtins;
};
}
treefmt.flakeModule
];
};
inputs = {
flake-parts.url = "github:hercules-ci/flake-parts";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
nix-filter.url = "github:numtide/nix-filter";
treefmt.url = "github:numtide/treefmt-nix";
};
}