gonix

package module
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2026 License: Apache-2.0 Imports: 21 Imported by: 0

README

gonix

Experimental high-level Go SDK for working with Nix.

gonix is an ergonomic Go layer built on top of its bundled pkg/raw package. That package contains low-level generated bindings to the Nix C API and narrow binding-owned adapters for Nix functionality that has no public C equivalent.

The goal of this package is to expose Nix concepts through Go-native APIs: contexts, stores, store paths, evaluation states, values, derivations, flakes, locked flakes, realised outputs, closures, settings, and structured errors.

Quick start

ctx := context.Background()

client, err := gonix.NewClient(gonix.ClientConfig{})
if err != nil {
	return err
}
defer client.Close()

f, err := client.OpenFlake("github:NixOS/nixpkgs/nixos-unstable")
if err != nil {
	return err
}
defer f.Close()

var pkg struct {
	Name    string `nix:"name" validate:"required"`
	DrvPath string `nix:"drvPath" validate:"required"`
}
err = client.EvalFlakeOutput(
	ctx,
	f,
	[]string{"legacyPackages", gonix.DefaultSystem(), "hello"},
	&pkg,
)
outputs, err := client.Realize(ctx, pkg.DrvPath)

Core features and concepts

gonix is currently an early SDK foundation. Client provides a flake-first quick start, while nixcontext and the public subpackages support lower-level composition.

  • Flake-first Client API with automatic resource orchestration.
  • Composable contexts, stores, evaluators, settings, and values for advanced workflows.
  • Explicit ownership with idempotent Close methods and documented borrowed, cloned, and refcounted resources.
  • Nix settings, verbosity, log formatting, structured errors, and cooperative cancellation.
  • Store paths, derivations, realization, closures, copying, GC roots, and garbage collection.
  • Expression evaluation, value traversal and construction, function calls, and unmarshalling into Go values.
  • Flake reference parsing, locking, input overrides, output traversal, lock metadata, and fingerprints.
  • Go-native APIs over the bundled low-level pkg/raw package.
  • Package discovery, indexing, metadata normalization, and policy remain the responsibility of software built on gonix.

Evaluation and unmarshalling

Client.Eval runs expressions through the real Nix evaluator and decodes the result directly into Go data:

var result struct {
	Message string         `nix:"message" validate:"required"`
	Ports   []int          `nix:"ports" validate:"required"`
	Flags   map[string]bool `nix:"flags" validate:"required"`
}

err := client.Eval(ctx, `{
  message = "hello from Nix";
  ports = [ 80 443 ];
  flags = { tls = true; };
}`, &result)

Evaluation supports ordinary Nix language semantics, including functions, imports, laziness, builtins, conditionals, attribute sets, and lists, subject to the configured evaluator and enabled Nix features.

High-level operations accept a context.Context. Cancellation requests Nix interruption, waits for the native operation to stop, and closes the Client because interrupted remote stores cannot be reused safely. A Client permits only one operation at a time and reports ErrConcurrentUse for overlaps.

The unmarshaller currently supports:

  • strings and paths into Go strings;
  • integers, floats, and booleans;
  • null into nil pointers;
  • lists into slices and fixed-length arrays;
  • attribute sets into structs and maps with string keys;
  • nested combinations of supported values;
  • nix field names and validate:"required" fields.

It does not currently decode functions, derivations as dedicated Go types, string contexts, external values, interfaces or union types, arbitrary map key types, or custom decoder implementations. Advanced callers can use the lower-level eval package to work with caller-owned Nix values directly.

Flake outputs and realization

Client.EvalFlakeOutput traverses the output attributes of a locked flake and decodes the selected value into Go data:

var packageName string
err := client.EvalFlakeOutput(
	ctx,
	f,
	[]string{"legacyPackages", gonix.DefaultSystem(), "hello", "name"},
	&packageName,
)

Each path element is one exact attribute name, so an attribute containing a dot is addressed as a single slice element. An empty path decodes the complete flake output attribute set.

Advanced workflows can keep the selected output as a caller-owned *eval.Value:

value, err := client.GetFlakeOutputValue(
	ctx,
	f,
	[]string{"legacyPackages", gonix.DefaultSystem(), "hello"},
)
defer value.Close()

var pkg struct {
	Name    string `nix:"name" validate:"required"`
	DrvPath string `nix:"drvPath" validate:"required"`
}
err = client.Unmarshal(ctx, value, &pkg)

Every attribute lookup returns an independently referenced Nix value. GetFlakeOutputValue closes intermediate values during traversal and transfers ownership of only the final value to the caller. The value must be closed before its Client.

Client.Realize(ctx, drvPath) builds or substitutes every output of a derivation path and returns Go-owned RealizedOutput values. Client.RealizeOutput(ctx, drvPath, outputName) asks Nix for exactly one named output and returns the same DTO shape. Gonix intentionally leaves package discovery, package metadata normalization, indexing, and policy to higher-level package managers.

Flake lock metadata

Each opened Flake caches Nix's normalized resolved lock graph and optional fingerprint during construction:

lock, err := f.LockInfo()
fingerprint := f.Fingerprint()

The cached graph can be supplied later as a reference lock while opening the same root flake:

f, err := client.OpenFlakeFromLock(ref, lock)

LockInfo types the lock graph, nodes, non-flake flags, and override parent paths. LockInput.GetNode and LockInput.GetFollows safely distinguish Nix's direct-node and follows-path JSON variants. Fetcher-specific original and locked reference attributes remain json.RawMessage values so new Nix input schemes do not require gonix API changes. LockNode.Flake normalizes Nix's omitted-true JSON convention into an ordinary Go bool. The returned graph shares no mutable data with the cache and may be modified by the caller.

The fingerprint is Nix's lowercase hexadecimal locked-flake cache key. It is empty when Nix cannot fingerprint the source or considers the graph unlocked. The fragment, lock information, and fingerprint remain available after the Flake or Client is closed.

Development

The root flake provides Go, cgo, c-for-go, pkg-config, golangci-lint, and the Nix libraries used by both SDK layers.

nix develop
make generate
make test
make lint
make check

make generate regenerates the low-level Go package in pkg/raw.

License

This repository contains separately licensed parts:

  • Gonix code outside pkg/raw is licensed under Apache-2.0; see LICENSE.
  • Everything under pkg/raw is licensed under LGPL-2.1-or-later; see pkg/raw/LICENSE.
  • The linked Nix libraries and other dependencies retain their own license terms.

Documentation

Index

Constants

View Source
const (
	// VerbosityDefault leaves the current Nix verbosity unchanged.
	VerbosityDefault = nixcontext.VerbosityDefault
	// VerbosityError shows only errors.
	VerbosityError = nixcontext.VerbosityError
	// VerbosityWarn shows warnings and errors.
	VerbosityWarn = nixcontext.VerbosityWarn
	// VerbosityNotice shows notices, warnings, and errors.
	VerbosityNotice = nixcontext.VerbosityNotice
	// VerbosityInfo shows informational messages.
	VerbosityInfo = nixcontext.VerbosityInfo
	// VerbosityTalkative shows talkative Nix logs.
	VerbosityTalkative = nixcontext.VerbosityTalkative
	// VerbosityChatty shows chatty Nix logs.
	VerbosityChatty = nixcontext.VerbosityChatty
	// VerbosityDebug shows debug Nix logs.
	VerbosityDebug = nixcontext.VerbosityDebug
	// VerbosityVomit shows the most verbose Nix logs.
	VerbosityVomit = nixcontext.VerbosityVomit
)
View Source
const (
	// LogFormatRaw writes raw log messages.
	LogFormatRaw = nixcontext.LogFormatRaw
	// LogFormatRawWithLogs writes raw log messages including log records.
	LogFormatRawWithLogs = nixcontext.LogFormatRawWithLogs
	// LogFormatInternalJSON writes Nix's internal JSON log format.
	LogFormatInternalJSON = nixcontext.LogFormatInternalJSON
	// LogFormatBar writes progress-bar formatted logs.
	LogFormatBar = nixcontext.LogFormatBar
	// LogFormatBarWithLogs writes progress-bar formatted logs including log records.
	LogFormatBarWithLogs = nixcontext.LogFormatBarWithLogs
)

Variables

View Source
var ErrClosed = status.ErrClosed

ErrClosed is returned when an operation is attempted after a wrapper has been closed.

View Source
var ErrConcurrentUse = errors.New("gonix: concurrent use of Client is not supported")

ErrConcurrentUse is returned when a Client operation overlaps another operation or Close call on the same Client.

Functions

func DefaultSystem

func DefaultSystem() string

DefaultSystem returns the Nix system identifier for the current Go runtime.

func MakeSystem

func MakeSystem(os OS, arch Arch) string

MakeSystem constructs a Nix system identifier from OS and architecture.

Types

type Arch

type Arch string

Arch identifies the architecture component of a Nix system.

const (
	// Arch386 identifies Go's 386 architecture as Nix i686.
	Arch386 Arch = ArchI686
	// ArchAarch64 identifies 64-bit ARM.
	ArchAarch64 Arch = "aarch64"
	// ArchAarch64BE identifies big-endian 64-bit ARM.
	ArchAarch64BE Arch = "aarch64_be"
	// ArchArc identifies Synopsys ARC.
	ArchArc Arch = "arc"
	// ArchArm identifies generic ARM.
	ArchArm Arch = "arm"
	// ArchArmv5tel identifies ARMv5 little-endian.
	ArchArmv5tel Arch = "armv5tel"
	// ArchArmv6l identifies ARMv6 little-endian.
	ArchArmv6l Arch = "armv6l"
	// ArchArmv7a identifies ARMv7-A.
	ArchArmv7a Arch = "armv7a"
	// ArchArmv7l identifies ARMv7 little-endian.
	ArchArmv7l Arch = "armv7l"
	// ArchAvr identifies AVR.
	ArchAvr Arch = "avr"
	// ArchI686 identifies 32-bit x86.
	ArchI686 Arch = "i686"
	// ArchJavascript identifies JavaScript.
	ArchJavascript Arch = "javascript"
	// ArchLoong64 identifies Go's loong64 architecture as Nix loongarch64.
	ArchLoong64 Arch = ArchLoongArch64
	// ArchLoongArch64 identifies LoongArch64.
	ArchLoongArch64 Arch = "loongarch64"
	// ArchM68k identifies Motorola 68000.
	ArchM68k Arch = "m68k"
	// ArchMicroBlaze identifies MicroBlaze.
	ArchMicroBlaze Arch = "microblaze"
	// ArchMicroBlazeEL identifies little-endian MicroBlaze.
	ArchMicroBlazeEL Arch = "microblazeel"
	// ArchMIPS identifies big-endian MIPS.
	ArchMIPS Arch = "mips"
	// ArchMIPS64 identifies big-endian MIPS64.
	ArchMIPS64 Arch = "mips64"
	// ArchMIPS64EL identifies little-endian MIPS64.
	ArchMIPS64EL Arch = "mips64el"
	// ArchMIPSEL identifies little-endian MIPS.
	ArchMIPSEL Arch = "mipsel"
	// ArchMIPSLE identifies Go's mipsle architecture as Nix mipsel.
	ArchMIPSLE Arch = ArchMIPSEL
	// ArchMMIX identifies MMIX.
	ArchMMIX Arch = "mmix"
	// ArchMSP430 identifies MSP430.
	ArchMSP430 Arch = "msp430"
	// ArchOR1K identifies OpenRISC 1000.
	ArchOR1K Arch = "or1k"
	// ArchPPC64 identifies Go's ppc64 architecture as Nix powerpc64.
	ArchPPC64 Arch = ArchPowerPC64
	// ArchPPC64LE identifies Go's ppc64le architecture as Nix powerpc64le.
	ArchPPC64LE Arch = ArchPowerPC64LE
	// ArchPowerPC identifies PowerPC.
	ArchPowerPC Arch = "powerpc"
	// ArchPowerPC64 identifies 64-bit PowerPC.
	ArchPowerPC64 Arch = "powerpc64"
	// ArchPowerPC64LE identifies little-endian 64-bit PowerPC.
	ArchPowerPC64LE Arch = "powerpc64le"
	// ArchPowerPCLE identifies little-endian PowerPC.
	ArchPowerPCLE Arch = "powerpcle"
	// ArchRISCV32 identifies 32-bit RISC-V.
	ArchRISCV32 Arch = "riscv32"
	// ArchRISCV64 identifies 64-bit RISC-V.
	ArchRISCV64 Arch = "riscv64"
	// ArchRX identifies Renesas RX.
	ArchRX Arch = "rx"
	// ArchS390 identifies IBM S/390.
	ArchS390 Arch = "s390"
	// ArchS390X identifies IBM z/Architecture.
	ArchS390X Arch = "s390x"
	// ArchSH4 identifies SuperH SH-4.
	ArchSH4 Arch = "sh4"
	// ArchVC4 identifies VideoCore IV.
	ArchVC4 Arch = "vc4"
	// ArchWasm32 identifies 32-bit WebAssembly.
	ArchWasm32 Arch = "wasm32"
	// ArchWasm64 identifies 64-bit WebAssembly.
	ArchWasm64 Arch = "wasm64"
	// ArchX86_64 identifies 64-bit x86.
	ArchX86_64 Arch = "x86_64"
)

func (Arch) String

func (a Arch) String() string

String returns the Nix architecture identifier.

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client owns the resources for high-level Nix workflows.

Client owns a hidden Nix context, a default store and evaluator, fetcher and flake settings. Flakes created through OpenFlake may be closed early by the caller and are otherwise closed by Client.Close. Client is not goroutine-safe and rejects overlapping operations with ErrConcurrentUse. Close releases owned resources in reverse dependency order.

func NewClient

func NewClient(cfg ClientConfig) (*Client, error)

NewClient creates a flake-ready Client.

ClientConfig{} is a valid quick-start configuration. The returned Client owns all resources it creates and must be closed.

func (*Client) Close

func (c *Client) Close() error

Close releases flakes created by the Client, followed by its evaluator, store, settings, and context.

Close is idempotent. It attempts every cleanup and joins multiple errors.

func (*Client) Eval

func (c *Client) Eval(ctx context.Context, expr string, out any) (err error)

Eval evaluates expr and decodes its result into out.

The out argument must be a non-nil pointer to a type supported by eval.Evaluator.Unmarshal. Use the eval package directly when the raw caller-owned Value or a custom diagnostic path is needed.

func (*Client) EvalFlakeOutput

func (c *Client) EvalFlakeOutput(ctx context.Context, f *flake.Flake, path []string, out any) error

EvalFlakeOutput decodes a locked flake output selected by path into out.

Each path element names one exact Nix attribute; dots have no special meaning. An empty path decodes the complete flake output attribute set. The out argument must be a non-nil pointer to a type supported by eval.Evaluator.Unmarshal.

func (*Client) EvalWithArgs added in v1.4.0

func (c *Client) EvalWithArgs(ctx context.Context, expr string, args, out any) error

EvalWithArgs evaluates expr as a function, applies args, and decodes its result into out.

Args may be nil, a boolean, string, integer, float, slice, or map with string keys. Slices and maps may contain nested combinations of those types. The out argument must be a non-nil pointer to a type supported by eval.Evaluator.Unmarshal.

func (*Client) GetFlakeOutputValue

func (c *Client) GetFlakeOutputValue(ctx context.Context, f *flake.Flake, path []string) (*eval.Value, error)

GetFlakeOutputValue returns the flake output selected by path.

Each path element names one exact Nix attribute; dots have no special meaning. An empty path returns the complete flake output attribute set.

The returned Value is caller-owned and must be closed.

func (*Client) OpenFlake

func (c *Client) OpenFlake(ref string, opts ...flake.Option) (*flake.Flake, error)

OpenFlake parses and locks ref.

The returned Flake may be closed early by the caller. If it remains open, Client.Close closes it before releasing the resources it borrows.

func (*Client) ProcessDaemonConnection added in v1.2.0

func (c *Client) ProcessDaemonConnection(ctx context.Context, fromFD, toFD int, trusted, recursive bool) error

ProcessDaemonConnection processes separate input and output file descriptors.

ProcessDaemonConnection duplicates both descriptors, sets the duplicates to blocking mode, and closes only the duplicates after Nix returns.

func (*Client) Realize

func (c *Client) Realize(ctx context.Context, drvPath string) ([]RealizedOutput, error)

Realize realizes every output of the derivation at drvPath.

Realize returns pure Go DTOs and closes the Nix store path handles produced by Nix before returning. The Client's store must support realization.

func (*Client) RealizeOutput added in v1.3.0

func (c *Client) RealizeOutput(ctx context.Context, drvPath string, outputName string) (RealizedOutput, error)

RealizeOutput realizes one named output of the derivation at drvPath.

RealizeOutput returns a pure Go DTO and closes the Nix store path handle produced by Nix before returning. The Client's store must support realization.

func (*Client) Unmarshal

func (c *Client) Unmarshal(ctx context.Context, value *eval.Value, out any) error

Unmarshal decodes value into out using the Client's evaluator.

Value must belong to this Client's evaluator. The out argument must be a non-nil pointer to a type supported by eval.Evaluator.Unmarshal.

func (*Client) WithEvaluator

func (c *Client) WithEvaluator(ctx context.Context, handler func(*eval.Evaluator) error) error

WithEvaluator runs handler with the Client's owned Evaluator.

The operation participates in Client cancellation and exclusive-use handling. The Evaluator is borrowed and must not be closed or retained by handler.

func (*Client) WithStore

func (c *Client) WithStore(ctx context.Context, handler func(*store.Store) error) error

WithStore runs handler with the Client's owned Store.

The operation participates in Client cancellation and exclusive-use handling. The Store is borrowed and must not be closed or retained by handler.

func (*Client) WithStoreAndEvaluator

func (c *Client) WithStoreAndEvaluator(ctx context.Context, handler func(*store.Store, *eval.Evaluator) error) error

WithStoreAndEvaluator runs handler with the Client's owned Store and Evaluator.

The operation participates in Client cancellation and exclusive-use handling. Both resources are borrowed and must not be closed or retained by handler.

type ClientConfig

type ClientConfig struct {
	// LoadConfig loads the user's Nix configuration during context bootstrap.
	LoadConfig bool
	// AllowImportFromDerivation enables import-from-derivation when true.
	AllowImportFromDerivation bool
	// AcceptFlakeConfig accepts settings supplied by flakes when true.
	AcceptFlakeConfig bool
	// PureEval enables pure evaluation when true.
	PureEval bool
	// Cores sets the number of cores exposed to builders when non-zero.
	Cores int
	// MaxJobs sets the maximum number of local build jobs when non-zero.
	MaxJobs int
	// System sets the Nix build system when non-empty.
	System string
	// EvalSystem sets the Nix evaluation system when non-empty.
	EvalSystem string
	// Verbosity sets Nix verbosity when not VerbosityDefault.
	Verbosity Verbosity
	// LogFormat sets the Nix log format when non-empty.
	LogFormat LogFormat
	// LogSinkPath sets the Nix log sink destination.
	LogSinkPath string
	// ExperimentalFeatures replaces the default feature list when non-empty.
	ExperimentalFeatures []string
	// Substituters sets substituter store URLs when non-empty.
	Substituters []string
	// TrustedPublicKeys sets trusted binary cache keys when non-empty.
	TrustedPublicKeys []string
	// Store configures the Client's owned default store.
	Store StoreConfig
	// Eval configures the Client's owned evaluator.
	Eval EvalConfig
	// RawSettings applies exact Nix setting values after typed fields and wins
	// on key conflicts.
	RawSettings map[string]string
}

ClientConfig configures Client creation.

The zero value preserves Nix defaults except that it enables nix-command and flakes, which are required by the Client flake workflow. Zero-value scalar fields are treated as unset. Use RawSettings to explicitly set false, zero, max-jobs=auto, or another exact Nix setting value.

func (ClientConfig) Serialize

func (c ClientConfig) Serialize() map[string]string

Serialize returns the Nix settings represented by c.

Returned settings are detached from c. List fields are deduplicated, sorted, and joined with spaces. RawSettings is applied last.

type Error

type Error = status.NixError

Error describes a Nix failure captured by gonix.

It is a stable, Go-native snapshot of a Nix context error: the status code, human-readable message, and any structured upstream Nix details that were available when the error was converted.

type ErrorCode

type ErrorCode = status.ErrorCode

ErrorCode identifies a Nix C API status code returned through gonix errors.

const (
	// ErrorCodeOK reports that a Nix operation completed successfully.
	ErrorCodeOK ErrorCode = status.ErrorCodeOK

	// ErrorCodeUnknown reports a generic failure not described by a narrower code.
	ErrorCodeUnknown ErrorCode = status.ErrorCodeUnknown

	// ErrorCodeOverflow reports that a value did not fit in the requested representation.
	ErrorCodeOverflow ErrorCode = status.ErrorCodeOverflow

	// ErrorCodeKey reports a missing or invalid key, setting, attribute, or lookup name.
	ErrorCodeKey ErrorCode = status.ErrorCodeKey

	// ErrorCodeNix reports a structured upstream Nix exception.
	ErrorCodeNix ErrorCode = status.ErrorCodeNix

	// ErrorCodeRecoverable reports a failure that Nix classified as recoverable.
	ErrorCodeRecoverable ErrorCode = status.ErrorCodeRecoverable
)

type EvalConfig

type EvalConfig struct {
	// Opts are passed to eval.New before Client installs its required flake
	// settings integration.
	Opts []eval.Option
}

EvalConfig configures the evaluator owned by Client.

type ExperimentalFeature

type ExperimentalFeature = string

ExperimentalFeature is a Go-native Nix experimental feature name.

The type is open: use any newer Nix feature name before gonix adds a named constant.

const (
	// ExperimentalFeatureNixCommand enables the modern nix command surface.
	ExperimentalFeatureNixCommand ExperimentalFeature = "nix-command"
	// ExperimentalFeatureFlakes enables flake evaluation support.
	ExperimentalFeatureFlakes ExperimentalFeature = "flakes"
	// ExperimentalFeatureFetchTree enables the fetch-tree experimental feature.
	ExperimentalFeatureFetchTree ExperimentalFeature = "fetch-tree"
	// ExperimentalFeatureCADerivations enables content-addressed derivations.
	ExperimentalFeatureCADerivations ExperimentalFeature = "ca-derivations"
)

type LogFormat

type LogFormat = nixcontext.LogFormat

LogFormat is a Go-native Nix log format.

type OS

type OS string

OS identifies the operating-system component of a Nix system.

const (
	// OSAIX identifies IBM AIX.
	OSAIX OS = "aix"
	// OSAndroid identifies Android.
	OSAndroid OS = "android"
	// OSCygwin identifies Cygwin.
	OSCygwin OS = "cygwin"
	// OSDarwin identifies Darwin-based systems.
	OSDarwin OS = "darwin"
	// OSDragonFly identifies DragonFly BSD.
	OSDragonFly OS = "dragonfly"
	// OSFreeBSD identifies FreeBSD.
	OSFreeBSD OS = "freebsd"
	// OSGenode identifies Genode.
	OSGenode OS = "genode"
	// OSGHCJS identifies the GHCJS JavaScript target.
	OSGHCJS OS = "ghcjs"
	// OSHurd identifies GNU Hurd.
	OSHurd OS = "hurd"
	// OSIllumos identifies illumos.
	OSIllumos OS = "illumos"
	// OSIOS identifies iOS.
	OSIOS OS = "ios"
	// OSLinux identifies Linux.
	OSLinux OS = "linux"
	// OSMMIXWare identifies MMIXware.
	OSMMIXWare OS = "mmixware"
	// OSNetBSD identifies NetBSD.
	OSNetBSD OS = "netbsd"
	// OSNone identifies a bare-metal or freestanding target.
	OSNone OS = "none"
	// OSOpenBSD identifies OpenBSD.
	OSOpenBSD OS = "openbsd"
	// OSPlan9 identifies Plan 9.
	OSPlan9 OS = "plan9"
	// OSRedox identifies Redox.
	OSRedox OS = "redox"
	// OSSolaris identifies Solaris.
	OSSolaris OS = "solaris"
	// OSUEFI identifies UEFI.
	OSUEFI OS = "uefi"
	// OSWasi identifies WASI.
	OSWasi OS = "wasi"
	// OSWasip1 identifies Go's WASI preview 1 target.
	OSWasip1 OS = "wasip1"
	// OSWindows identifies Windows.
	OSWindows OS = "windows"
)

func (OS) String

func (os OS) String() string

String returns the Nix operating-system identifier.

type RealizedOutput

type RealizedOutput struct {
	OutputName string   `json:"outputName"`
	StorePath  string   `json:"storePath"`
	RealPath   string   `json:"realPath"`
	Name       string   `json:"name"`
	Hash       [20]byte `json:"hash"`
}

RealizedOutput describes one realized derivation output.

It contains only Go-owned data. Client.Realize and Client.RealizeOutput close the underlying Nix store path handles before returning this DTO.

type StoreConfig

type StoreConfig struct {
	// URI is the store URI. The empty value uses store.Auto.
	URI string
	// Opts are passed to store.New.
	Opts []store.Option
}

StoreConfig configures the store owned by Client.

type Verbosity

type Verbosity = nixcontext.Verbosity

Verbosity is a Go-native Nix verbosity level.

Directories

Path Synopsis
cmd
example command
Package eval wraps Nix evaluation states and values.
Package eval wraps Nix evaluation states and values.
Package fetchers wraps Nix fetcher settings.
Package fetchers wraps Nix fetcher settings.
Package flake provides owned locked flakes and access to their output values.
Package flake provides owned locked flakes and access to their output values.
internal
Package nixcontext owns and initializes Nix C API contexts.
Package nixcontext owns and initializes Nix C API contexts.
pkg
raw
Generated Go bindings for the Nix C API.
Generated Go bindings for the Nix C API.
utils
Package utils provides shared adapters for values returned by pkg/raw.
Package utils provides shared adapters for values returned by pkg/raw.
Package store wraps Nix store handles and store-backed operations.
Package store wraps Nix store handles and store-backed operations.
Package storepath wraps Nix store path handles.
Package storepath wraps Nix store path handles.

Jump to

Keyboard shortcuts

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