Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 26 additions & 7 deletions nix/tuna.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{
nix-filter,
lib,
buildDunePackage,
stdenv,
dune,
ocaml,
zarith,
ppx_deriving,
ppx_yojson_conv,
Expand All @@ -14,8 +16,9 @@
ppx_jane,
alcotest,
}:
buildDunePackage rec {
pname = "tunac";

stdenv.mkDerivation rec {
name = "tunac";
version = "1.0.0";

src = with nix-filter.lib; filter {
Expand All @@ -29,6 +32,11 @@ buildDunePackage rec {
];
};

nativeBuildInputs = [
dune
ocaml
];

propagatedBuildInputs = [
zarith
ppx_deriving
Expand All @@ -40,9 +48,9 @@ buildDunePackage rec {

buildInputs = [
yojson
core
core_unix
ppx_jane
core
core_unix
ppx_jane
];

checkInputs = [
Expand All @@ -51,5 +59,16 @@ buildDunePackage rec {

doCheck = true;

meta.mainProgram = "tunacc_test_operation";
buildPhase = ''
runHook preBuild
dune build --profile=release ./packages/tunac/bin/tunacc_test_operation.exe
runHook postBuild
'';

installPhase = ''
runHook preInstall
mkdir -p $out/lib $out/bin
cp _build/default/packages/tunac/bin/tunacc_test_operation.exe $out/bin/tunac
runHook postInstall
'';
}