mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-16 06:45:16 +01:00
6afb255d97
these changes were generated with nixq 0.0.2, by running nixq ">> lib.mdDoc[remove] Argument[keep]" --batchmode nixos/**.nix nixq ">> mdDoc[remove] Argument[keep]" --batchmode nixos/**.nix nixq ">> Inherit >> mdDoc[remove]" --batchmode nixos/**.nix two mentions of the mdDoc function remain in nixos/, both of which are inside of comments. Since lib.mdDoc is already defined as just id, this commit is a no-op as far as Nix (and the built manual) is concerned.
58 lines
1.3 KiB
Nix
58 lines
1.3 KiB
Nix
{ config, extendModules, lib, ... }:
|
|
let
|
|
|
|
inherit (lib)
|
|
mkOption
|
|
;
|
|
|
|
vmVariant = extendModules {
|
|
modules = [ ./qemu-vm.nix ];
|
|
};
|
|
|
|
vmVariantWithBootLoader = vmVariant.extendModules {
|
|
modules = [
|
|
({ config, ... }: {
|
|
_file = "nixos/default.nix##vmWithBootLoader";
|
|
virtualisation.useBootLoader = true;
|
|
virtualisation.useEFIBoot =
|
|
config.boot.loader.systemd-boot.enable ||
|
|
config.boot.loader.efi.canTouchEfiVariables;
|
|
})
|
|
];
|
|
};
|
|
in
|
|
{
|
|
options = {
|
|
|
|
virtualisation.vmVariant = mkOption {
|
|
description = ''
|
|
Machine configuration to be added for the vm script produced by `nixos-rebuild build-vm`.
|
|
'';
|
|
inherit (vmVariant) type;
|
|
default = {};
|
|
visible = "shallow";
|
|
};
|
|
|
|
virtualisation.vmVariantWithBootLoader = mkOption {
|
|
description = ''
|
|
Machine configuration to be added for the vm script produced by `nixos-rebuild build-vm-with-bootloader`.
|
|
'';
|
|
inherit (vmVariantWithBootLoader) type;
|
|
default = {};
|
|
visible = "shallow";
|
|
};
|
|
|
|
};
|
|
|
|
config = {
|
|
|
|
system.build = {
|
|
vm = lib.mkDefault config.virtualisation.vmVariant.system.build.vm;
|
|
vmWithBootLoader = lib.mkDefault config.virtualisation.vmVariantWithBootLoader.system.build.vm;
|
|
};
|
|
|
|
};
|
|
|
|
# uses extendModules
|
|
meta.buildDocsInSandbox = false;
|
|
}
|