32 lines
890 B
Nix
32 lines
890 B
Nix
{ 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;
|
|
}
|