about summary refs log tree commit diff
path: root/users/picnoir/tvix-daemon/default.nix
blob: 78b9aa9a1d1c73b78814e85668eef5a71043e1e6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
{ 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"
  ];
}