Skip to content

Commit 030d055

Browse files
FlafyDevastro
authored andcommitted
feat: add evaluatedConfig field
This field allows using custom system configs, not necessarily nixos' eval-config
1 parent 52ba519 commit 030d055

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

nixos-modules/host/default.nix

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ in
5858
isFlake = flake != null;
5959
guestConfig = if isFlake
6060
then flake.nixosConfigurations.${name}.config
61-
else microvmConfig.config.config;
61+
else if microvmConfig.evaluatedConfig != null
62+
then microvmConfig.evaluatedConfig.config
63+
else microvmConfig.config.config;
6264
runner = guestConfig.microvm.declaredRunner;
6365
in
6466
{

nixos-modules/host/options.nix

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,15 @@
3030
vms = mkOption {
3131
type = with types; attrsOf (submodule ({ config, name, ... }: {
3232
options = {
33+
evaluatedConfig = mkOption {
34+
description = ''
35+
An already evaluated configuration of this MicroVM.
36+
Allows supplying an already evaluated configuration or an alternative configuration evaluation function instead of NixOS's default eval-config.
37+
'';
38+
default = null;
39+
type = nullOr types.unspecified;
40+
};
41+
3342
config = mkOption {
3443
description = ''
3544
A specification of the desired configuration of this MicroVM,

0 commit comments

Comments
 (0)