tests: add buildwmwithbootloader stub

This commit is contained in:
steveej 2018-09-23 14:09:35 +02:00
parent 71ad857210
commit 617a84a384
3 changed files with 86 additions and 0 deletions

View file

@ -0,0 +1,32 @@
{ system ? builtins.currentSystem
, vmPkgsPath
, buildPkgsPath
, nixosConfigPath
}:
let
buildPkgs = import buildPkgsPath {};
vmPkgs'= import vmPkgsPath {};
vmPkgs = vmPkgs' // {
runtimeShell = "${vmPkgs'.bash}/${vmPkgs'.bash.shellPath}";
};
importWithPkgs = { path, pkgs }: args: import path (args // { inherit pkgs; });
nixosConfig = importWithPkgs { path = "${nixosConfigPath}"; pkgs = vmPkgs; };
vmConfig = importWithPkgs { path = "${buildPkgsPath}/nixos/modules/virtualisation/qemu-vm.nix"; pkgs = vmPkgs; };
evalConfig = importWithPkgs { path = "${vmPkgsPath}/nixos/lib/eval-config.nix"; pkgs = null; };
vmWithBootLoaderConfigMixed = (evalConfig {
modules = [
nixosConfig
vmConfig
{
virtualisation.useBootLoader = true;
}
];
}).config;
in {
vmWithBootLoaderMixed = vmWithBootLoaderConfigMixed.system.build.vm;
}