CLI reference¶
Generated from pynix's live command tree — see docs/_generate_pynix_reference.py. Every command also accepts --help for the same information at the terminal.
pynix¶
pynix — nanopynix CLI
pynix build¶
Build a Nix derivation value
Argument |
Type |
Help |
|---|---|---|
|
|
Evaluate FILE as a Nix expression. FILE is a path, a lookup path, a URL, or a flake reference, and it may end with '#' and an attribute path. (default: |
|
|
Dot-separated attribute path within the evaluation result. (default: |
|
|
Evaluate FLAKE, optionally with a '#'-separated attribute path. (default: |
|
|
Store URI to build with. (default: |
|
|
Store URI to evaluate with. Defaults to --store. (default: |
|
|
Space-separated substituter URLs. (default: |
|
|
Space-separated substituter public keys. (default: |
|
|
Nix log verbosity: error, warn, notice, info, talkative, chatty, debug, vomit, or 0-7. (default: |
|
|
Print build log lines to stderr. (default: |
|
|
Update plain fixed-output hash literals after a hash mismatch. (default: |
|
|
Show --update-fod changes without writing or rebuilding. (default: |
|
|
Build in a private user namespace, against an overlay store whose lower layer is the host store. Nothing is copied in, the host store does not change, and this process owns the sandbox settings that the daemon otherwise controls. Linux only. (default: |
|
|
Keep the overlay's upper layer here, instead of in a temporary directory that is deleted on exit. Reuse the same directory to keep what earlier --namespaced builds produced. Implies --namespaced. (default: |
|
|
Copy the outputs of a --namespaced build into the host store when the build succeeds. Without it the outputs are gone when the worker exits. (default: |
|
|
Extra path to mount into the build sandbox, as /inside=/outside or /path. Repeatable. Requires --namespaced, because the daemon does not let a client change its sandbox. (default: |
pynix config¶
Inspect Nix configuration
pynix config show¶
Show Nix configuration settings
Argument |
Type |
Help |
|---|---|---|
|
|
Show only one setting. (default: |
pynix config check¶
Check that Nix configuration can be loaded
pynix config current-system¶
Show the effective system used by builtins.currentSystem
pynix copy¶
Copy the closure of a store path from one store to another
Argument |
Type |
Help |
|---|---|---|
|
|
Store paths to copy. Give none when --file or --flake names the target. (default: |
|
|
Evaluate FILE as a Nix expression. FILE is a path, a lookup path, a URL, or a flake reference, and it may end with '#' and an attribute path. (default: |
|
|
Dot-separated attribute path within the evaluation result. (default: |
|
|
Evaluate FLAKE, optionally with a '#'-separated attribute path. (default: |
|
|
Store URI to copy into. --store is the other side. (default: |
|
|
Store URI to copy out of. --store is the other side. (default: |
|
|
Refuse a path that the destination store cannot verify a signature for. (default: |
|
|
Store URI for the side that --to or --from does not name. (default: |
pynix eval¶
Evaluate a Nix expression and print the result as JSON
Argument |
Type |
Help |
|---|---|---|
|
|
Nix expression to evaluate. Reads from stdin if not provided. (default: |
|
|
Evaluate FILE as a Nix expression. FILE is a path, a lookup path, a URL, or a flake reference, and it may end with '#' and an attribute path. (default: |
|
|
Dot-separated attribute path within the evaluation result. (default: |
|
|
Evaluate FLAKE, optionally with a '#'-separated attribute path. (default: |
|
|
Store URI to evaluate with. (default: |
pynix derivation¶
Inspect and manipulate Nix derivations
pynix derivation show¶
Show the contents of a Nix derivation
Examples: pynix derivation show --file default.nix --attr hello pynix derivation show --flake .#hello pynix derivation show --flake nixpkgs#python3Packages.requests
Argument |
Type |
Help |
|---|---|---|
|
|
Evaluate FILE as a Nix expression. FILE is a path, a lookup path, a URL, or a flake reference, and it may end with '#' and an attribute path. (default: |
|
|
Dot-separated attribute path within the evaluation result. (default: |
|
|
Evaluate FLAKE, optionally with a '#'-separated attribute path. (default: |
|
|
Store URI to use. (default: |
pynix develop¶
Run a command, or an interactive bash, in a derivation's build environment
Everything after -- is the command. Without a command, this starts an interactive bash.
Examples: pynix develop --file default.nix --attr hello pynix develop --flake .# -- make -j4 pynix develop --flake .# -- bash -c 'make | less'
Argument |
Type |
Help |
|---|---|---|
|
|
Evaluate FILE as a Nix expression. FILE is a path, a lookup path, a URL, or a flake reference, and it may end with '#' and an attribute path. (default: |
|
|
Dot-separated attribute path within the evaluation result. (default: |
|
|
Evaluate FLAKE, optionally with a '#'-separated attribute path. (default: |
|
|
Store URI to build with. (default: |
|
|
Store URI to evaluate with. Defaults to --store. (default: |
|
|
Nix log verbosity: error, warn, notice, info, talkative, chatty, debug, vomit, or 0-7. (default: |
|
|
Print build log lines to stderr. (default: |
|
|
Command to run in the environment, after --. Omit for an interactive bash. (default: |
pynix flake¶
Inspect and manage Nix flakes
pynix flake show¶
Show the outputs provided by a flake
Argument |
Type |
Help |
|---|---|---|
|
|
Flake reference (e.g. '.#' or 'nixpkgs#'). (required) |
|
|
Dot-separated attribute path within the flake outputs to start from. (default: |
|
|
Store URI to evaluate with. (default: |
pynix flake metadata¶
Show locked flake metadata
Argument |
Type |
Help |
|---|---|---|
|
|
Flake reference (e.g. '.' or 'nixpkgs'). (required) |
|
|
Store URI to evaluate with. (default: |
pynix flake info¶
Alias for flake metadata
Argument |
Type |
Help |
|---|---|---|
|
|
Flake reference (e.g. '.' or 'nixpkgs'). (required) |
|
|
Store URI to evaluate with. (default: |
pynix log¶
Show the build log for a store path
Argument |
Type |
Help |
|---|---|---|
|
|
Store path whose build log should be printed. (required) |
|
|
Store URI to query. (default: |
pynix path-info¶
Show information about a store path
Argument |
Type |
Help |
|---|---|---|
|
|
Store path to query (e.g. '/nix/store/hash-name'). (required) |
|
|
Store URI to query. (default: |
pynix print-dev-env¶
Print the build environment of a derivation
Examples: pynix print-dev-env --file default.nix --attr hello pynix print-dev-env --flake .#hello --json
Argument |
Type |
Help |
|---|---|---|
|
|
Evaluate FILE as a Nix expression. FILE is a path, a lookup path, a URL, or a flake reference, and it may end with '#' and an attribute path. (default: |
|
|
Dot-separated attribute path within the evaluation result. (default: |
|
|
Evaluate FLAKE, optionally with a '#'-separated attribute path. (default: |
|
|
Store URI to build with. (default: |
|
|
Store URI to evaluate with. Defaults to --store. (default: |
|
|
Nix log verbosity: error, warn, notice, info, talkative, chatty, debug, vomit, or 0-7. (default: |
|
|
Print build log lines to stderr. (default: |
|
|
Print the environment as JSON, instead of the bash that restores it. (default: |
pynix registry¶
Manage the flake registry, which resolves an indirect flake reference
pynix registry list¶
List every flake registry entry, with the layer that holds it
Argument |
Type |
Help |
|---|---|---|
|
|
Store URI to query. (default: |
pynix registry add¶
Point one flake reference at another
Argument |
Type |
Help |
|---|---|---|
|
|
Flake reference to resolve, for example 'nixpkgs'. (required) |
|
|
Flake reference it resolves to, for example 'github:NixOS/nixpkgs'. (required) |
|
|
Registry file to change. Defaults to the registry of the user. (default: |
|
|
Store URI to use. (default: |
pynix registry remove¶
Drop every entry for one flake reference
Argument |
Type |
Help |
|---|---|---|
|
|
Flake reference to drop, for example 'nixpkgs'. (required) |
|
|
Registry file to change. Defaults to the registry of the user. (default: |
|
|
Store URI to use. (default: |
pynix registry pin¶
Pin a flake reference to the reference it resolves to now
Argument |
Type |
Help |
|---|---|---|
|
|
Flake reference to pin, for example 'nixpkgs'. (required) |
|
|
Flake reference to pin it to. Defaults to the reference itself. (default: |
|
|
Registry file to change. Defaults to the registry of the user. (default: |
|
|
Store URI to use. (default: |
pynix repl¶
Open an interactive Nix evaluation session.
Argument |
Type |
Help |
|---|---|---|
|
|
Store URI to evaluate with. (default: |
|
|
Evaluate FILE as a Nix expression. FILE is a path, a lookup path, a URL, or a flake reference, and it may end with '#' and an attribute path. (default: |
|
|
Dot-separated attribute path within the evaluation result. (default: |
|
|
Evaluate FLAKE, optionally with a '#'-separated attribute path. (default: |
pynix search¶
Search the NixOS options and the packages of one target.
Argument |
Type |
Help |
|---|---|---|
|
|
Search query. Omit to just (re)build the index. (default: |
|
|
Evaluate FILE as a Nix expression. FILE is a path, a lookup path, a URL, or a flake reference, and it may end with '#' and an attribute path. (default: |
|
|
Dot-separated attribute path within the evaluation result. (default: |
|
|
Evaluate FLAKE, optionally with a '#'-separated attribute path. (default: |
|
|
Search the NixOS module options only. Without this and --packages, the search reads whichever of the two the target offers. (default: |
|
|
Search the packages only. Without this and --options, the search reads whichever of the two the target offers. (default: |
|
|
Attribute path to the options tree, relative to the target. The default tries 'options'. (default: |
|
|
Attribute path to nixpkgs lib, relative to the target. The default tries 'lib', then the 'lib' of the package set that the target holds. (default: |
|
|
Attribute path to the package set, relative to the target. The default tries 'pkgs', then '_module.args.pkgs', and then the target itself. (default: |
|
|
The system whose binaries the package index answers for. The default is this machine. (default: |
|
|
The channel to read programs.sqlite from, when the nixpkgs of the target carries none. (default: |
|
|
Re-evaluate and rebuild the cached index instead of using it. (default: |
|
|
Maximum number of results to print. (default: |
|
|
Print results as JSON instead of a human-readable list. (default: |
|
|
Browse the results in a full-screen interface. The default opens it for a person at a terminal who gave no query, and prints a list otherwise. (default: |
|
|
Store URI to evaluate with. (default: |
pynix store¶
Manage the Nix store
pynix store gc¶
Manage Nix store garbage collection
pynix store gc print-roots¶
List the garbage collector roots
Argument |
Type |
Help |
|---|---|---|
|
|
Store URI to query. (default: |
pynix store gc print-dead¶
List paths that would be removed by a garbage collection. Use --rip to actually delete them.
Argument |
Type |
Help |
|---|---|---|
|
|
Actually delete the dead store paths instead of just listing them. (default: |
|
|
Store URI to query. (default: |
pynix store gc print-alive¶
List live paths in the store (reachable from GC roots)
Argument |
Type |
Help |
|---|---|---|
|
|
Store URI to query. (default: |
pynix store info¶
Show store metadata
Argument |
Type |
Help |
|---|---|---|
|
|
Store URI to query. (default: |
pynix store dirs¶
Show configured local store directories
Argument |
Type |
Help |
|---|---|---|
|
|
Store URI to query. (default: |
pynix store is-valid-path¶
Check whether a store path is valid
Argument |
Type |
Help |
|---|---|---|
|
|
Store path to check. (required) |
|
|
Store URI to query. (default: |
pynix store follow-links-to-store-path¶
Resolve symlinks to a store path
Argument |
Type |
Help |
|---|---|---|
|
|
Filesystem path to resolve. (required) |
|
|
Store URI to query. (default: |
pynix store compute-fs-closure¶
Compute the filesystem closure of a store path
Argument |
Type |
Help |
|---|---|---|
|
|
Store path to query. (required) |
|
|
Compute the inverse closure. (default: |
|
|
Include derivation outputs. (default: |
|
|
Include derivers. (default: |
|
|
Store URI to query. (default: |
pynix store query-missing¶
Show which paths would need building, substituting, or are unknown
Argument |
Type |
Help |
|---|---|---|
|
|
Store paths to query. (default: |
|
|
Store URI to query. (default: |
pynix store query-derivation-outputs¶
Show the outputs of a derivation path
Argument |
Type |
Help |
|---|---|---|
|
|
Derivation path to query. (required) |
|
|
Store URI to query. (default: |
pynix store query-valid-derivers¶
Show valid derivers for a store path
Argument |
Type |
Help |
|---|---|---|
|
|
Store path to query. (required) |
|
|
Store URI to query. (default: |
pynix store list-valid-paths¶
List all valid paths in the store
Argument |
Type |
Help |
|---|---|---|
|
|
Store URI to query. (default: |
pynix store query-referrers¶
Show referrers of a store path
Argument |
Type |
Help |
|---|---|---|
|
|
Store path to query. (required) |
|
|
Store URI to query. (default: |
pynix store query-substitutable-paths¶
Show which paths are substitutable
Argument |
Type |
Help |
|---|---|---|
|
|
Store paths to query. (default: |
|
|
Store URI to query. (default: |
pynix store add-temp-root¶
Add a temporary GC root for this command's store session
Argument |
Type |
Help |
|---|---|---|
|
|
Store path to root temporarily. (required) |
|
|
Store URI to use. (default: |
pynix store add-perm-root¶
Add a permanent GC root symlink
Argument |
Type |
Help |
|---|---|---|
|
|
Store path to root. (required) |
|
|
GC root symlink to create. (required) |
|
|
Store URI to use. (default: |
pynix store add-indirect-root¶
Register an indirect GC root
Argument |
Type |
Help |
|---|---|---|
|
|
GC root path to register. (required) |
|
|
Store URI to use. (default: |
pynix store path-from-hash-part¶
Resolve a store path from its hash prefix
Argument |
Type |
Help |
|---|---|---|
|
|
Store path hash prefix to resolve. (required) |
|
|
Store URI to query. (default: |
pynix store ensure-path¶
Ensure a store path is valid, substituting it if available
Argument |
Type |
Help |
|---|---|---|
|
|
Store path to ensure. (required) |
|
|
Store URI to use. (default: |
pynix store cat¶
Print a file inside a local Nix store path
Argument |
Type |
Help |
|---|---|---|
|
|
File path to print. (required) |
|
|
Store URI to use. (default: |
pynix store ls¶
List files inside a local Nix store path
Argument |
Type |
Help |
|---|---|---|
|
|
File or directory path to list. (required) |
|
|
Print machine-readable JSON. (default: |
|
|
Store URI to use. (default: |
pynix store add¶
Add a file or directory to a Nix store
Argument |
Type |
Help |
|---|---|---|
|
|
Filesystem path to add. (required) |
|
|
Override the store path name component. (default: |
|
|
Content-addressing method: nar, flat, or git. (default: |
|
|
Hash algorithm to use. (default: |
|
|
Compute the store path without adding the content. (default: |
|
|
Store URI to use. (default: |
pynix store add-file¶
Add a single file to a Nix store
Argument |
Type |
Help |
|---|---|---|
|
|
Filesystem path to add. (required) |
|
|
Override the store path name component. (default: |
|
|
Hash algorithm to use. (default: |
|
|
Compute the store path without adding the content. (default: |
|
|
Store URI to use. (default: |
pynix store add-path¶
Add a path to a Nix store using NAR ingestion
Argument |
Type |
Help |
|---|---|---|
|
|
Filesystem path to add. (required) |
|
|
Override the store path name component. (default: |
|
|
Hash algorithm to use. (default: |
|
|
Compute the store path without adding the content. (default: |
|
|
Store URI to use. (default: |
pynix store diff-closures¶
Compare two filesystem closures
Argument |
Type |
Help |
|---|---|---|
|
|
Original store path. (required) |
|
|
New store path. (required) |
|
|
Store URI to query. (default: |
pynix store optimise¶
Optimise store disk usage by hard-linking duplicate files
Argument |
Type |
Help |
|---|---|---|
|
|
Store URI to optimise. (default: |
pynix store verify¶
Verify store integrity
Argument |
Type |
Help |
|---|---|---|
|
|
Check path contents, not only metadata. (default: |
|
|
Attempt repair while verifying. (default: |
|
|
Store URI to verify. (default: |
pynix why-depends¶
Show the chain of references that puts one store path in the closure of another
Argument |
Type |
Help |
|---|---|---|
|
|
Store path whose closure to search (e.g. '/nix/store/hash-name'). (required) |
|
|
Store path to find in that closure. (required) |
|
|
For each link of the chain, name the file that holds the reference. Needs a local store. (default: |
|
|
Store URI to query. (default: |