tvl-depot/users/picnoir/tvix-daemon/default.nix
Ilan Joselevich 8b624f93bf feat(users/picnoir/tvix-daemon): Add crate2nix-check
Change-Id: I92a2fd6369e1f45c8afa25f778ac424782699b55
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12304
Reviewed-by: flokli <flokli@flokli.de>
Autosubmit: Ilan Joselevich <personal@ilanjoselevich.com>
Tested-by: BuildkiteCI
2024-08-23 19:55:10 +00:00

53 lines
1.3 KiB
Nix

{ depot, pkgs, ... }:
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;
clippy = pkgs.stdenv.mkDerivation {
name = "tvix-daemon-clippy";
# The cleaned sources.
src = depot.third_party.gitignoreSource ./.;
cargoDeps = crate2nix.allWorkspaceMembers;
nativeBuildInputs = with pkgs; [
cargo
clippy
pkg-config
protobuf
rustc
rustPlatform.cargoSetupHook
];
buildPhase = "cargo clippy --tests --all-features --benches --examples | tee $out";
};
crate2nix-check =
let
crate2nix-check = depot.tvix.utils.mkCrate2nixCheck ./Cargo.nix;
in
crate2nix-check.command.overrideAttrs {
meta.ci.extraSteps = {
inherit crate2nix-check;
};
};
meta.ci.targets = [
"tvix-daemon"
"shell"
"crate2nix-check"
];
}