Core
UCI Configuration
Packages
Files and Keys
Secrets and Raw Commands
Library Functions
Option Type Default Description
uci.packageManagerenum [ "opkg" "apk" ]"opkg"Package manager backend. Use apk on OpenWrt 25.12+, opkg on older releases.
uci.watchdogTimeoutint60Rollback watchdog timeout in seconds.
uci.verboseboolfalsePass --verbose to deploy (stage banners + remote set -x). A CLI -v takes precedence.
uci.portnullOr intnullSSH port injected into deploy; transport-only, ignored by compile/diff. A CLI --port takes precedence.
uci.identitynullOr strnullSSH identity path injected as --identity, shell-quoted; a string (not a path) so the key is not copied into the Nix store. A CLI -i takes precedence.
Option Type Default Description
uci.settings(pkgs.formats.json {}).type{}UCI configuration (config → section → option).
Option Type Default Description
uci.packageslistOf str[]Packages to install; prefix - to remove (e.g. -tcpdump).
uci.packageSources.opkgFeedslistOf str[]opkg feeds (src/gz <name> <url>), written to /etc/opkg/customfeeds.conf.
uci.packageSources.apkRepositorieslistOf str[]apk repository URLs, written to /etc/apk/repositories.d/customfeeds.list.
uci.packageSources.localPackageslistOf (either str path)[]Local .ipk / .apk files, streamed to the target /tmp/.
opkgFeeds and apkRepositories are mutually exclusive and must match packageManager.
Option Type Default Description
uci.fileslistOf (submodule)[]Custom files; see submodule below.
uci.sshKeyslistOf str[]Keys deployed to /etc/dropbear/authorized_keys (0600).
- sshKeys entries may carry an OpenSSH command="..." restriction, but the value must not contain shell metacharacters (;, &, ` , `` ``, $(), $(, etc.). is_valid_authorized_keyrejects such keys as a conservative hardening measure — acommand= that embeds shell syntax is treated as a potential injection vector, not a literal. If you need restricted keys, keep the command a single quoted program path plus arguments with no shell operators.
Option Type Default Description
pathstrrequired Absolute destination path on the target.
contentnullOr strnullText content; empty string creates a zero-byte file. Mutually exclusive with base64.
base64nullOr strnullBase64 binary content. Mutually exclusive with content.
checksumnullOr strnullExpected SHA256; skips the write if the target hash matches.
executableboolfalsetrue sets 0755, false sets 0644.
Option Type Default Description
uci.secrets.sops.fileslistOf path[]SOPS-encrypted files, decrypted in memory at compile time to fill @name@ placeholders.
uci.rawUcilistOf str[]Raw UCI command lines; must start with "uci ".
@name@ placeholder scope : settings option values, opkgFeeds / apkRepositories, rawUci, files.content, sshKeys. Not supported in packages, localPackages, or files.base64.
Returns json (a derivation producing uci.json) and command (a wrapper script running nuci compile / nuci deploy).
Bakes compiled UCI directives into /etc/uci-defaults/99-nuci-bootstrap and inherits settings, packages, packageSources, sshKeys, files, rawUci.