diff --git a/CHANGELOG.md b/CHANGELOG.md index ba3e4cae..0119ba34 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## Unreleased: `main` branch +* Runner scripts now forward command-line arguments to the hypervisor, + allowing extra VMM options for a single invocation with + `nix run .#my-microvm -- `. + * Shell scripts to setup virtiofsd, interfaces, and PCI devices for pass-through have moved from systemd units in the host to the `bin/` subdirectory of MicroVM packages. That means you can actually use diff --git a/doc/src/packages.md b/doc/src/packages.md index 3c3be27b..3e3b472a 100644 --- a/doc/src/packages.md +++ b/doc/src/packages.md @@ -23,3 +23,9 @@ packages.x86_64-linux.my-microvm = self.nixosConfigurations.my-microvm.config.mi ``` You can then run the MicroVM with a simple `nix run .#my-microvm` + +## Pass extra hypervisor arguments + +Use `nix run .#my-microvm -- ` to pass extra arguments to the +hypervisor for a single run. The runner appends them after the configured +hypervisor arguments and any arguments from `microvm.extraArgsScript`. diff --git a/lib/runner.nix b/lib/runner.nix index 73329533..a8623038 100644 --- a/lib/runner.nix +++ b/lib/runner.nix @@ -182,7 +182,7 @@ let '' } - exec ${execArg} ${command} ''${runtime_args:-} + exec ${execArg} ${command} ''${runtime_args:-} "$@" ''; } // lib.optionalAttrs canShutdown {