github cachix/devenv v2.4.0

3 hours ago

Machines (experimental)

  • Added devenv machines to define, build, install, and deploy machines alongside a development environment. It supports NixOS, nix-darwin, and home-manager. Use devenv machines info to inspect a configuration or devenv 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 deploy builds the outputs, shows what will change, and asks for confirmation before activating them. Use --yes for automation. To review now and deploy later, save a plan with devenv machines plan and apply its plan ID with devenv machines apply; --json can export the plan.
  • devenv machines check reviews 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 status and devenv machines rollback to 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-concurrent limits 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>.wantedBy to select a task when another task runs. after and before still control ordering. Garage now sets up its layout and buckets with both devenv up garage and devenv up (#2852).

Bug Fixes

  • devenv shell and direnv now use the port allocated to a running service instead of its base port. For example, PostgreSQL's PGPORT points to the running database. Direnv and the hot reloading shell also update their environments when processes start or stop (#3208).
  • devenv shell now handles quoted commands such as devenv shell "git log" (#3187).
  • Closing a terminal while devenv shell writes output no longer crashes it or leaves a coredump (#3203).
  • devenv shell no longer runs test setup, including devenv:git-hooks:run and tasks with before = [ "devenv:enterTest" ] (#3184).
  • Treefmt now runs after devenv:files during shell entry, avoiding intermittent errors when it reads managed files.
  • devenv mcp releases evaluation memory after loading its package and option caches, reducing idle memory use (#3065).
  • devenv lsp no longer fails at startup with Already registered store with name 'Dummy Store' (#3196).
  • Nested devenv commands in devenv-run-tests --override-input now use the same overridden inputs.

Don't miss a new devenv release

NewReleases is sending notifications on new releases.