Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion nixos-modules/host/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ in
isFlake = flake != null;
guestConfig = if isFlake
then flake.nixosConfigurations.${name}.config
else microvmConfig.config.config;
else if microvmConfig.evaluatedConfig != null
then microvmConfig.evaluatedConfig.config
else microvmConfig.config.config;
runner = guestConfig.microvm.declaredRunner;
in
{
Expand Down
9 changes: 9 additions & 0 deletions nixos-modules/host/options.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,15 @@
vms = mkOption {
type = with types; attrsOf (submodule ({ config, name, ... }: {
options = {
evaluatedConfig = mkOption {
description = ''
An already evaluated configuration of this MicroVM.
Allows supplying an already evaluated configuration or an alternative configuration evaluation function instead of NixOS's default eval-config.
'';
default = null;
type = nullOr types.unspecified;
};

config = mkOption {
description = ''
A specification of the desired configuration of this MicroVM,
Expand Down