tvl-depot/users/picnoir/tvix-daemon/default.nix
Florian Klink 49b63fceee fix(users/picnoir/tvix-daemon): gitignore target dir, use cleaned src
This prevents the nix build copying the target/ dir into the store
whenever this is built through Nix.

Change-Id: I397228fd8e2e3265ed87d3400fe927bc505da090
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11496
Tested-by: BuildkiteCI
Autosubmit: flokli <flokli@flokli.de>
Reviewed-by: picnoir picnoir <picnoir@alternativebit.fr>
2024-04-23 15:14:42 +00:00

43 lines
1 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";
};
meta.ci.targets = [
"tvix-daemon"
"shell"
];
}