2d51da7f40
`code.tvl.fyi/tvix/store/protos` now points to a directory that only contains the `.proto` files, while all golang tooling and .pb.go files live in tvix/store-go. As discussed in https://cl.tvl.fyi/c/depot/+/9787/comment/fc5d155c_1bd38e3a/, the amount of people currently using this is still small, so rename the go.mod now, while it doesn't yet hurt. Also, use code.tvl.fyi/tvix/castore-go instead of code.tvl.fyi/tvix/ castore/protos, to make use of cl/9791. Change-Id: I9ea89957d7c29dfae4c893b9aae8ac8a0bad2d8e Reviewed-on: https://cl.tvl.fyi/c/depot/+/9792 Autosubmit: flokli <flokli@flokli.de> Tested-by: BuildkiteCI Reviewed-by: Connor Brewster <cbrewster@hey.com>
73 lines
2.3 KiB
Protocol Buffer
73 lines
2.3 KiB
Protocol Buffer
// SPDX-License-Identifier: MIT
|
|
// Copyright © 2022 The Tvix Authors
|
|
syntax = "proto3";
|
|
|
|
package tvix.store.v1;
|
|
|
|
import "tvix/castore/protos/castore.proto";
|
|
|
|
option go_package = "code.tvl.fyi/tvix/store-go;storev1";
|
|
|
|
// PathInfo shows information about a Nix Store Path.
|
|
// That's a single element inside /nix/store.
|
|
message PathInfo {
|
|
// The path can be a directory, file or symlink.
|
|
tvix.castore.v1.Node node = 1;
|
|
|
|
// List of references (output path hashes)
|
|
// This really is the raw *bytes*, after decoding nixbase32, and not a
|
|
// base32-encoded string.
|
|
repeated bytes references = 2;
|
|
|
|
// see below.
|
|
NARInfo narinfo = 3;
|
|
|
|
// The StorePath of the .drv file producing this output.
|
|
// The .drv suffix is omitted in its `name` field.
|
|
StorePath deriver = 4;
|
|
}
|
|
|
|
// Represents a path in the Nix store (a direct child of STORE_DIR).
|
|
// It is commonly formatted by a nixbase32-encoding the digest, and
|
|
// concatenating the name, separated by a `-`.
|
|
message StorePath {
|
|
// The string after digest and `-`.
|
|
string name = 1;
|
|
|
|
// The digest (20 bytes).
|
|
bytes digest = 2;
|
|
}
|
|
|
|
// Nix C++ uses NAR (Nix Archive) as a format to transfer store paths,
|
|
// and stores metadata and signatures in NARInfo files.
|
|
// Store all these attributes in a separate message.
|
|
//
|
|
// This is useful to render .narinfo files to clients, or to preserve/validate
|
|
// these signatures.
|
|
// As verifying these signatures requires the whole NAR file to be synthesized,
|
|
// moving to another signature scheme is desired.
|
|
// Even then, it still makes sense to hold this data, for old clients.
|
|
message NARInfo {
|
|
// This represents a (parsed) signature line in a .narinfo file.
|
|
message Signature {
|
|
string name = 1;
|
|
bytes data = 2;
|
|
};
|
|
|
|
// This size of the NAR file, in bytes.
|
|
uint64 nar_size = 1;
|
|
|
|
// The sha256 of the NAR file representation.
|
|
bytes nar_sha256 = 2;
|
|
|
|
// The signatures in a .narinfo file.
|
|
repeated Signature signatures = 3;
|
|
|
|
// A list of references. To validate .narinfo signatures, a fingerprint
|
|
// needs to be constructed.
|
|
// This fingerprint doesn't just contain the hashes of the output paths of
|
|
// all references (like PathInfo.references), but their whole (base)names,
|
|
// so we need to keep them somewhere.
|
|
repeated string reference_names = 4;
|
|
|
|
}
|