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
9 changes: 7 additions & 2 deletions lib/make-disk-image.nix
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,17 @@ let
}
);
cleanedConfig = diskoLib.testLib.prepareDiskoConfig config diskoLib.testLib.devices;
# Merge any disko.devices settings from extraConfig into the cleaned config
# This allows tests.extraConfig to override disko settings like settings.keyFile
mergedDiskoDevices = lib.recursiveUpdate cleanedConfig.disko.devices (
cfg.extraConfig.disko.devices or { }
);
systemToInstall = extendModules {
modules = [
cfg.extraConfig
{
disko.testMode = true;
disko.devices = lib.mkForce cleanedConfig.disko.devices;
disko.devices = lib.mkForce mergedDiskoDevices;
boot.loader.grub.devices = lib.mkForce cleanedConfig.boot.loader.grub.devices;
}
];
Expand All @@ -73,7 +78,7 @@ let
cfg.extraConfig
{
disko.testMode = true;
disko.devices = lib.mkForce cleanedConfig.disko.devices;
disko.devices = lib.mkForce mergedDiskoDevices;
boot.loader.grub.devices = lib.mkForce cleanedConfig.boot.loader.grub.devices;
boot.kernelPackages = lib.mkDefault cfg.kernelPackages;
nixpkgs.hostPlatform = lib.mkForce pkgs.stdenv.hostPlatform;
Expand Down
6 changes: 5 additions & 1 deletion lib/tests.nix
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,11 @@ let
(modulesPath + "/testing/test-instrumentation.nix") # we need these 2 modules always to be able to run the tests
(modulesPath + "/profiles/qemu-guest.nix")
];
disko.devices = lib.mkForce testConfigBooted.disko.devices;
# Merge extraSystemConfig's disko.devices settings into testConfigBooted
# This allows tests.extraConfig to override disko settings like settings.keyFile
disko.devices = lib.mkForce (
lib.recursiveUpdate testConfigBooted.disko.devices (extraSystemConfig.disko.devices or { })
);
}
)
];
Expand Down