Documentation
¶
Overview ¶
Package nardump writes a NAR (Nix Archive) representation of an fs.FS to an io.Writer, or summarizes it as a Subresource Integrity hash, as used by Nix flake.nix vendor and toolchain hashes.
For the format, see: https://gist.github.com/jbeda/5c79d2b1434f0018d693
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SRI ¶
SRI returns the Subresource Integrity hash of the NAR encoding of fsys, in the form "sha256-<base64>". This is the format Nix expects for vendorHash and similar fields.
func WriteNAR ¶
WriteNAR writes a NAR-encoded representation of fsys, rooted at the FS root, to w.
The encoder issues many small writes; if w is not already a *bufio.Writer, WriteNAR wraps it in one and flushes on return so the caller doesn't have to.
fsys must implement fs.ReadLinkFS to encode any symlinks it contains; os.DirFS satisfies this on Go 1.25+.
Types ¶
This section is empty.