templates/ocaml/flake.nix

31 lines
750 B
Nix
Raw Permalink Normal View History

2024-04-08 21:04:23 +02:00
{
description = "A bare minimum OCaml flake";
inputs = {
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (sys:
let pkgs = import nixpkgs { system = sys; };
opkgs = pkgs.ocamlPackages; # pkgs.ocaml-ng.ocamlPackages_VERSION
project = opkgs.buildDunePackage {
pname = "my_project";
version = "0.1.0";
src = ./.;
buildInputs = with opkgs; [
base64
];
};
in {
packages.default = project;
devShells.default = pkgs.mkShell {
packages = [ opkgs.utop ];
inputsFrom = [ project ];
};
}
);
}