nixos/default.nix: Use extendModules
This commit is contained in:
parent
8086f8658e
commit
8fd49c116b
@ -10,25 +10,22 @@ let
|
|||||||
};
|
};
|
||||||
|
|
||||||
# This is for `nixos-rebuild build-vm'.
|
# This is for `nixos-rebuild build-vm'.
|
||||||
vmConfig = (import ./lib/eval-config.nix {
|
vm = eval.extendModules {
|
||||||
inherit system;
|
modules = [ ./modules/virtualisation/qemu-vm.nix ];
|
||||||
modules = [ configuration ./modules/virtualisation/qemu-vm.nix ];
|
};
|
||||||
}).config;
|
|
||||||
|
|
||||||
# This is for `nixos-rebuild build-vm-with-bootloader'.
|
# This is for `nixos-rebuild build-vm-with-bootloader'.
|
||||||
vmWithBootLoaderConfig = (import ./lib/eval-config.nix {
|
vmWithBootLoader = vm.extendModules {
|
||||||
inherit system;
|
modules = [
|
||||||
modules =
|
({ config, ... }: {
|
||||||
[ configuration
|
_file = "nixos/default.nix##vmWithBootLoader";
|
||||||
./modules/virtualisation/qemu-vm.nix
|
virtualisation.useBootLoader = true;
|
||||||
{ virtualisation.useBootLoader = true; }
|
virtualisation.useEFIBoot =
|
||||||
({ config, ... }: {
|
config.boot.loader.systemd-boot.enable ||
|
||||||
virtualisation.useEFIBoot =
|
config.boot.loader.efi.canTouchEfiVariables;
|
||||||
config.boot.loader.systemd-boot.enable ||
|
})
|
||||||
config.boot.loader.efi.canTouchEfiVariables;
|
];
|
||||||
})
|
};
|
||||||
];
|
|
||||||
}).config;
|
|
||||||
|
|
||||||
in
|
in
|
||||||
|
|
||||||
@ -37,7 +34,7 @@ in
|
|||||||
|
|
||||||
system = eval.config.system.build.toplevel;
|
system = eval.config.system.build.toplevel;
|
||||||
|
|
||||||
vm = vmConfig.system.build.vm;
|
vm = vm.config.system.build.vm;
|
||||||
|
|
||||||
vmWithBootLoader = vmWithBootLoaderConfig.system.build.vm;
|
vmWithBootLoader = vmWithBootLoader.config.system.build.vm;
|
||||||
}
|
}
|
||||||
|
@ -92,7 +92,7 @@ in withWarnings {
|
|||||||
|
|
||||||
# Merge the option definitions in all modules, forming the full
|
# Merge the option definitions in all modules, forming the full
|
||||||
# system configuration.
|
# system configuration.
|
||||||
inherit (nixosWithUserModules) config options _module type;
|
inherit (nixosWithUserModules) config options _module type extendModules;
|
||||||
|
|
||||||
inherit extraArgs;
|
inherit extraArgs;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user