binary-cache/pkgs/tvix/default.nix
2024-10-06 15:52:08 +02:00

51 lines
975 B
Nix

{
fetchgit,
fetchpatch,
rustPlatform,
protobuf,
packages ? [ ],
pname ? "tvix",
}:
rustPlatform.buildRustPackage rec {
inherit pname;
version = "0.1.0";
src = builtins.fetchGit {
name = "tvix";
url = "https://code.tvl.fyi/depot.git";
rev = "96a78877eb0d3109bd5b76345b9f1aa87bb3ec20";
};
patches = [
(fetchpatch {
url = "https://cl.tvl.fyi/changes/depot~12016/revisions/1/patch?download";
decode = "base64 -d";
hash = "sha256-ldIZkkbtYYAPHK62eYnYVudrZCdBqTIg3V27IutFPAA=";
})
];
postPatch = "cd tvix";
preBuild = ''
export PROTO_ROOT=$(realpath $PWD/..)
'';
doCheck = false;
cargoBuildFlags = builtins.concatStringsSep " " (
builtins.map (v: "-p ${v}") packages
++ [
"--features"
"tvix-store/xp-store-composition"
]
);
nativeBuildInputs = [ protobuf ];
cargoLock = {
lockFile = src + "/tvix/Cargo.lock";
allowBuiltinFetchGit = true;
};
meta = { };
}