mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-23 14:11:36 +00:00
f3d94cfc23
This reverts commit cad8957eab
. It
breaks NixOps, but more importantly, such major changes to the module
system really need to be reviewed.
44 lines
985 B
Nix
44 lines
985 B
Nix
{ configuration ? import ./lib/from-env.nix "NIXOS_CONFIG" <nixos-config>
|
|
, system ? builtins.currentSystem
|
|
}:
|
|
|
|
let
|
|
|
|
eval = import ./lib/eval-config.nix {
|
|
inherit system;
|
|
modules = [ configuration ];
|
|
};
|
|
|
|
inherit (eval) pkgs;
|
|
|
|
# This is for `nixos-rebuild build-vm'.
|
|
vmConfig = (import ./lib/eval-config.nix {
|
|
inherit system;
|
|
modules = [ configuration ./modules/virtualisation/qemu-vm.nix ];
|
|
}).config;
|
|
|
|
# This is for `nixos-rebuild build-vm-with-bootloader'.
|
|
vmWithBootLoaderConfig = (import ./lib/eval-config.nix {
|
|
inherit system;
|
|
modules =
|
|
[ configuration
|
|
./modules/virtualisation/qemu-vm.nix
|
|
{ virtualisation.useBootLoader = true; }
|
|
];
|
|
}).config;
|
|
|
|
in
|
|
|
|
{
|
|
inherit (eval) config options;
|
|
|
|
system = eval.config.system.build.toplevel;
|
|
|
|
vm = vmConfig.system.build.vm;
|
|
|
|
vmWithBootLoader = vmWithBootLoaderConfig.system.build.vm;
|
|
|
|
# The following are used by nixos-rebuild.
|
|
nixFallback = pkgs.nixUnstable;
|
|
}
|