Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ futures-util = "0.3"
async-compression = { version = "0.4", features = ["tokio", "zstd"] }
tokio-util = { version = "0.7", features = ["io"] }
bytes = "1"
harmonia-file-nar = { git = "https://github.com/nix-community/harmonia", rev = "773c2f5635c4e38e7fb932b5e22a80d23b279153" }
harmonia-store-path = { git = "https://github.com/nix-community/harmonia", rev = "773c2f5635c4e38e7fb932b5e22a80d23b279153" }
harmonia-store-path-info = { git = "https://github.com/nix-community/harmonia", rev = "773c2f5635c4e38e7fb932b5e22a80d23b279153" }
harmonia-utils-signature = { git = "https://github.com/nix-community/harmonia", rev = "773c2f5635c4e38e7fb932b5e22a80d23b279153" }
harmonia-store-remote = { git = "https://github.com/nix-community/harmonia", rev = "773c2f5635c4e38e7fb932b5e22a80d23b279153" }
harmonia-store-ref-scan = { git = "https://github.com/nix-community/harmonia", rev = "773c2f5635c4e38e7fb932b5e22a80d23b279153" }
harmonia-file-nar = { git = "https://github.com/nix-community/harmonia", rev = "0760dbe508a1162f05dc36bdf333b45318ee77a0" }
harmonia-store-path = { git = "https://github.com/nix-community/harmonia", rev = "0760dbe508a1162f05dc36bdf333b45318ee77a0" }
harmonia-store-path-info = { git = "https://github.com/nix-community/harmonia", rev = "0760dbe508a1162f05dc36bdf333b45318ee77a0" }
harmonia-utils-signature = { git = "https://github.com/nix-community/harmonia", rev = "0760dbe508a1162f05dc36bdf333b45318ee77a0" }
harmonia-store-remote = { git = "https://github.com/nix-community/harmonia", rev = "0760dbe508a1162f05dc36bdf333b45318ee77a0" }
harmonia-store-ref-scan = { git = "https://github.com/nix-community/harmonia", rev = "0760dbe508a1162f05dc36bdf333b45318ee77a0" }
16 changes: 16 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
description = "tribuchet - RBE-style remote build execution for Nix";

inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
inputs.crane.url = "github:ipetkov/crane";
# only used to evaluate the darwin module in checks
inputs.nix-darwin = {
url = "github:nix-darwin/nix-darwin";
Expand All @@ -12,6 +13,7 @@
{
self,
nixpkgs,
crane,
nix-darwin,
}:
let
Expand All @@ -34,7 +36,9 @@
./nix/patches/recursive-nix-external-builders.patch
];

default = pkgs.callPackage ./nix/package.nix { };
default = pkgs.callPackage ./nix/package.nix {
craneLib = crane.mkLib pkgs;
};
});

darwinModules.default = import ./nix/darwin-module.nix self;
Expand Down
44 changes: 23 additions & 21 deletions nix/package.nix
Original file line number Diff line number Diff line change
@@ -1,40 +1,42 @@
{
lib,
rustPlatform,
stdenv,
craneLib,
protobuf,
passt,
}:
let
# repository root is one level up from this file
root = ./..;
in
rustPlatform.buildRustPackage (
{
src = lib.fileset.toSource {
inherit root;
fileset = lib.fileset.unions [
(root + "/Cargo.toml")
(root + "/Cargo.lock")
(root + "/crates")
];
};

commonArgs = {
pname = "tribuchet";
version = "0.1.0";
src = lib.fileset.toSource {
inherit root;
fileset = lib.fileset.unions [
(root + "/Cargo.toml")
(root + "/Cargo.lock")
(root + "/crates")
];
};
cargoLock = {
lockFile = root + "/Cargo.lock";
# harmonia crates come from one pinned git rev; builtin
# fetchGit avoids enumerating an outputHash per crate
allowBuiltinFetchGit = true;
};
inherit src;
strictDeps = true;
nativeBuildInputs = [ protobuf ];
PROTOC = "${protobuf}/bin/protoc";
};

cargoArtifacts = craneLib.buildDepsOnly commonArgs;
in
craneLib.buildPackage (
commonArgs
// {
inherit cargoArtifacts;
# sandbox_runs_builder needs CAP_SYS_ADMIN that the outer
# Nix builder sandbox does not grant; `nix develop -c
# cargo test` runs it.
checkFlags = [
"--skip=worker::sandbox::tests::sandbox_runs_builder"
];
cargoTestExtraArgs = "-- --skip=worker::sandbox::tests::sandbox_runs_builder";
passthru = { inherit cargoArtifacts; };
}
// lib.optionalAttrs stdenv.isLinux {
# default network backend for fixed-output builds
Expand Down