nardump

package
v1.102.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 23, 2026 License: BSD-3-Clause Imports: 9 Imported by: 0

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

func SRI(fsys fs.FS) (string, error)

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

func WriteNAR(w io.Writer, fsys fs.FS) (err error)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL