create nix test infrastructure

This commit is contained in:
atagen 2024-12-03 12:25:08 +11:00
parent 192561577e
commit 0a9e1c089b
3 changed files with 84 additions and 11 deletions

View file

@ -1,15 +1,30 @@
{
ocaml-deps,
ocamlPackages,
version,
...
}:
lib,
ocaml-deps,
ocamlPackages,
version,
debug ? false,
...
}:
ocamlPackages.buildDunePackage {
pname = "culr";
version = "0.1-${version}";
pname = "culr";
version = "0.1-${version}";
minimalOCamlVersion = "5.2";
minimalOCamlVersion = "5.2";
src = ./..;
buildInputs = ocaml-deps;
src = ./..;
buildInputs = ocaml-deps;
buildPhase =
if debug
then ''
runHook preBuild
dune build --profile debug -p culr ''${enableParallelBuilding:+-j $NIX_BUILD_CORES}
runHook postBuild
''
else ''
runHook preBuild
dune build --profile release -p culr ''${enableParallelBuilding:+-j $NIX_BUILD_CORES}
runHook postBuild
'';
}