docs

ix

ix apply

Converge VMs on a project's configuration

Usage: ix apply [OPTIONS] [TARGETS]...

Converge VMs on a project's configuration.

Builds the flake target's NixOS system on the VM and activates it in place; re-running converges, the nixos-rebuild switch contract (a config-only project gets its flake.nix scaffolded on the first apply). Start a project with ix init.

With no target, converges every VM the flake declares: each nixosConfigurations entry that sets ix.networking, one VM per entry, named after the attribute. A project scaffolded by ix init declares ix.default and keeps converging that one VM.

To create a VM imperatively (from a template or a snapshot), use ix new instead.

arguments

  • <TARGETS> Flake target(s) like . or .#name. Several targets boot several VMs; a bare . converges the flake's ix.default, or every VM it declares when there is no ix.default default: .

options

  • -n, --name <NAME> VM name, defaulting to the target or directory name; re-apply the same name to converge that VM. With a bare target this also selects the single-VM path rather than the declared fleet: it converges ix.default where the flake exposes one, and nixosConfigurations.<name> otherwise -- so it reaches a configuration only when the attribute is itself a usable VM name
  • --region <REGION> Region for a VM created by this apply env: IX_REGION
  • --base <BASE> Base template the VM boots from when it must be created first default: ix/base:latest
  • --workdir <SOURCE_WORKDIR> Evaluate the flake in this subdirectory of the source default: .
  • --override-input <NAME=REL_PATH> Override a flake input with a path inside the source, as NAME=REL_PATH
  • --forge-credential <HOST[/OWNER]> Carry a forge credential from this machine so the evaluator and the guest builds can fetch a private flake input, scoped to HOST/OWNER (preferred) or HOST
  • --no-shell <NO_SHELL> Return when the VM is ready instead of opening a shell default: false
  • --json <JSON> Stream progress as newline-delimited JSON on stdout, one object per state change, for every VM in the apply default: false
  • --message-format <MESSAGE_FORMAT> Error format one of: human, short, json default: human

examples

  ix apply
  ix apply .#web .#worker
  ix apply --name one-vm