99 lines
2.2 KiB
Nix
99 lines
2.2 KiB
Nix
{
|
|
inputs = {
|
|
# nixpkgs.url = "github:nixOS/nixpkgs";
|
|
nixpkgs.follows = "ocaml-overlay/nixpkgs";
|
|
ocaml-overlay = {
|
|
url = "github:nix-ocaml/nix-overlays";
|
|
};
|
|
flake-utils.url = "github:numtide/flake-utils";
|
|
};
|
|
|
|
outputs = {
|
|
self,
|
|
nixpkgs,
|
|
flake-utils,
|
|
ocaml-overlay,
|
|
}: let
|
|
version = builtins.toString self.lastModified;
|
|
in
|
|
flake-utils.lib.eachDefaultSystem (
|
|
system: let
|
|
pkgs = import nixpkgs {
|
|
inherit system;
|
|
overlays = [
|
|
ocaml-overlay.overlays.default
|
|
];
|
|
extra-substituters = "https://anmonteiro.nix-cache.workers.dev";
|
|
extra-trusted-public-keys = "ocaml.nix-cache.com-1:/xI2h2+56rwFfKyyFVbkJSeGqSIYMC/Je+7XXqGKDIY=";
|
|
};
|
|
inherit (pkgs) mkShell ocaml-ng;
|
|
inherit
|
|
(ocaml-ng.ocamlPackages_5_2)
|
|
dune_3
|
|
ocaml
|
|
utop
|
|
ocaml-lsp
|
|
ocamlformat
|
|
ocamlformat-rpc-lib
|
|
angstrom
|
|
angstrom-unix
|
|
faraday
|
|
ppx_inline_test
|
|
hex
|
|
;
|
|
minimal = [
|
|
dune_3
|
|
ocaml
|
|
angstrom
|
|
angstrom-unix
|
|
faraday
|
|
ppx_inline_test
|
|
hex
|
|
];
|
|
dev = [
|
|
utop
|
|
ocaml-lsp
|
|
ocamlformat
|
|
ocamlformat-rpc-lib
|
|
];
|
|
in {
|
|
devShells.default = mkShell {
|
|
buildInputs = minimal ++ dev;
|
|
};
|
|
|
|
packages.default = pkgs.callPackage ./nix/default.nix {ocaml-deps = minimal; inherit version;};
|
|
|
|
defaultPackage = self.packages.${system}.default;
|
|
}
|
|
)
|
|
// {
|
|
nixosModules.culr = import ./nix/module.nix {overlay = self.overlays.culr;};
|
|
|
|
overlays.culr = final: prev: let
|
|
inherit
|
|
(prev.ocaml-ng)
|
|
dune_3
|
|
ocaml
|
|
angstrom
|
|
angstrom-unix
|
|
faraday
|
|
ppx_inline_test
|
|
hex
|
|
;
|
|
ocaml-deps = [
|
|
dune_3
|
|
ocaml
|
|
angstrom
|
|
angstrom-unix
|
|
faraday
|
|
ppx_inline_test
|
|
hex
|
|
];
|
|
in {
|
|
meat = final.callPackage ./nix/default.nix {
|
|
inherit ocaml-deps version;
|
|
};
|
|
};
|
|
};
|
|
}
|