Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Module

These are the available NixOS module options for nixos-cli. This is the preferred way to configure things like settings, and to add the CLI itself to the $PATH.

programs.nixos-cli.activation-interface.enable

Use the nixos activate interface to switch configurations, instead of the switch-to-configuration-ng program that is currently used in nixpkgs.

The behavior is mostly the same, but changes can be made that may potentially break behavior from the original on a per-case basis.

If this is disabled, users will still be able to use nixos activate on their own, but it will serve solely as a shim to run the switch script on a switchable system.

This activation interface is experimental and subject to change.

Type: boolean

Default: false

Example: true

programs.nixos-cli.enable

Whether to enable unified NixOS tooling replacement for nixos-* utilities.

Type: boolean

Default: false

Example: true

programs.nixos-cli.option-cache.enable

Prebuild JSON cache for nixos option command

Type: boolean

Default: true

programs.nixos-cli.option-cache.exclude

Exclude these options or option paths from being included in the pre-generated option cache.

This is a recursive action; excluding a path of "services.openssh", for example, means ALL options underneath that attribute set path of services.openssh will be excluded.

This is useful for skipping over options that do not evaluate properly, either due to upstream errors or some other unforeseen evaluation error.

Type: list of string

Default: [ ]

Example: [ "sops" "programs.optnix" "boot.loader.grub.zfsSupport" ]

programs.nixos-cli.package

Package to use for nixos-cli

Type: package

Default: <derivation nixos-cli-0.15.0-dev>

programs.nixos-cli.preserve-env

Environment variables to persist through root elevation command invocations on this host.

Supports automatically configuring sudo and doas environment rules only. sudo rules are configured as defaults, while doas environment variable rules are configured for the :wheel group only.

If you need more flexible definitions for these rules, consider using the default value of programs.nixos-cli.preserve-env as a reference list of default variables that should be preserved across this boundary.

It is recommended to use this option for any extra environment variables to preserve if apply.reexec_as_root is set in nixos-cli's settings.

Type: list of string

Default: [ "NIXOS_CLI_CONFIG" "NIXOS_CLI_DEBUG_MODE" "NIXOS_CLI_DISABLE_STEPS" "NIXOS_CLI_SUPPRESS_NO_SETTINGS_WARNING" "NIXOS_CONFIG" "NIXOS_GENERATION_TAG" "SSH_AUTH_SOCK" ]

programs.nixos-cli.settings

Configuration written to /etc/nixos-cli/config.toml

Type: TOML value

Default: { }