2024-03-21 16:09:43 +01:00
|
|
|
{ depot, pkgs, ... }:
|
2024-03-19 14:34:59 +01:00
|
|
|
|
|
|
|
let
|
|
|
|
crate2nix = pkgs.callPackage ./Cargo.nix {
|
|
|
|
defaultCrateOverrides = {
|
|
|
|
tvix-castore = prev: {
|
|
|
|
PROTO_ROOT = depot.tvix.castore.protos.protos;
|
|
|
|
nativeBuildInputs = protobufDep prev;
|
|
|
|
};
|
|
|
|
|
|
|
|
tvix-store = prev: {
|
|
|
|
PROTO_ROOT = depot.tvix.store.protos.protos;
|
|
|
|
nativeBuildInputs = protobufDep prev;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
protobufDep = prev: (prev.nativeBuildInputs or [ ]) ++ [ pkgs.buildPackages.protobuf ];
|
|
|
|
in
|
|
|
|
{
|
|
|
|
shell = (import ./shell.nix { inherit pkgs; });
|
|
|
|
tvix-daemon = crate2nix.rootCrate.build;
|
2024-03-21 16:09:43 +01:00
|
|
|
clippy = pkgs.stdenv.mkDerivation {
|
|
|
|
name = "tvix-daemon-clippy";
|
2024-04-20 21:01:04 +02:00
|
|
|
# The cleaned sources.
|
|
|
|
src = depot.third_party.gitignoreSource ./.;
|
|
|
|
cargoDeps = crate2nix.allWorkspaceMembers;
|
2024-03-21 16:09:43 +01:00
|
|
|
|
|
|
|
nativeBuildInputs = with pkgs; [
|
|
|
|
cargo
|
|
|
|
clippy
|
|
|
|
pkg-config
|
|
|
|
protobuf
|
|
|
|
rustc
|
|
|
|
rustPlatform.cargoSetupHook
|
|
|
|
];
|
|
|
|
|
|
|
|
buildPhase = "cargo clippy --tests --all-features --benches --examples | tee $out";
|
|
|
|
};
|
2024-08-23 19:16:17 +02:00
|
|
|
crate2nix-check =
|
|
|
|
let
|
|
|
|
crate2nix-check = depot.tvix.utils.mkCrate2nixCheck ./Cargo.nix;
|
|
|
|
in
|
|
|
|
crate2nix-check.command.overrideAttrs {
|
|
|
|
meta.ci.extraSteps = {
|
|
|
|
inherit crate2nix-check;
|
|
|
|
};
|
|
|
|
};
|
2024-03-19 14:34:59 +01:00
|
|
|
meta.ci.targets = [
|
|
|
|
"tvix-daemon"
|
|
|
|
"shell"
|
2024-08-23 19:16:17 +02:00
|
|
|
"crate2nix-check"
|
2024-03-19 14:34:59 +01:00
|
|
|
];
|
|
|
|
}
|