Machines (experimental)
- Added
devenv machinesto define, build, install, and deploy machines alongside a development environment. It supports NixOS, nix-darwin, and home-manager. Usedevenv machines infoto inspect a configuration ordevenv build machines.<name>to build it without contacting the target. devenv machines install <name>sets up a new NixOS host over SSH. It detects hardware, builds the system before partitioning disks, installs NixOS, and reboots. A failed build stops before disk changes; explicit disk-only operations can still run without a build. Installation can also bootstrap secrets with SecretSpec.devenv machines deploybuilds the outputs, shows what will change, and asks for confirmation before activating them. Use--yesfor automation. To review now and deploy later, save a plan withdevenv machines planand apply its plan ID withdevenv machines apply;--jsoncan export the plan.devenv machines checkreviews NixOS SSH access changes without building. Deployments reject configurations that disable SSH or root login, flag uncertain access changes, and reject stale plans.- NixOS activation runs on the target under a lock, with health checks and automatic rollback if it fails or is not confirmed before the deadline. Recovery can also run after reboot once NixOS reaches userspace. Use
devenv machines statusanddevenv machines rollbackto inspect or recover a deployment. - A single plan can include NixOS, nix-darwin, and home-manager roles. All roles are built and remote outputs copied before activation; system roles activate before home-manager.
--max-concurrentlimits parallel activation and stops later batches after a failure. NixOS checks the current generation and supports rollback; nix-darwin and home-manager activate directly.
Improvements
- Added
tasks.<name>.wantedByto select a task when another task runs.afterandbeforestill control ordering. Garage now sets up its layout and buckets with bothdevenv up garageanddevenv up(#2852).
Bug Fixes
devenv shelland direnv now use the port allocated to a running service instead of its base port. For example, PostgreSQL'sPGPORTpoints to the running database. Direnv and the hot reloading shell also update their environments when processes start or stop (#3208).devenv shellnow handles quoted commands such asdevenv shell "git log"(#3187).- Closing a terminal while
devenv shellwrites output no longer crashes it or leaves a coredump (#3203). devenv shellno longer runs test setup, includingdevenv:git-hooks:runand tasks withbefore = [ "devenv:enterTest" ](#3184).- Treefmt now runs after
devenv:filesduring shell entry, avoiding intermittent errors when it reads managed files. devenv mcpreleases evaluation memory after loading its package and option caches, reducing idle memory use (#3065).devenv lspno longer fails at startup withAlready registered store with name 'Dummy Store'(#3196).- Nested
devenvcommands indevenv-run-tests --override-inputnow use the same overridden inputs.