mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-21 13:10:33 +00:00
d72a34311a
This causes unintended schema upgrades, and is no longer needed now that we have nixos/modules/installer/tools/nix-fallback-paths.nix.
41 lines
905 B
Nix
41 lines
905 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;
|
|
}
|