mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-13 13:40:28 +03:00
Revert "modules/virtualisation: add shared options, merge various diskSize options" (#340894)
Breaks evaluation of all nixos tests, and is therefore a channel blocker.
This commit is contained in:
parent
757e0a34b7
commit
4cec81a995
15 changed files with 1293 additions and 1759 deletions
|
@ -1,37 +1,21 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{ config, pkgs, lib, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.hyperv;
|
||||
virtualisationOptions = import ./virtualisation-options.nix;
|
||||
|
||||
in
|
||||
{
|
||||
|
||||
imports = [
|
||||
virtualisationOptions.diskSize
|
||||
(lib.mkRenamedOptionModuleWith {
|
||||
sinceRelease = 2411;
|
||||
from = [
|
||||
"virtualisation"
|
||||
"hyperv"
|
||||
"baseImageSize"
|
||||
];
|
||||
to = [
|
||||
"virtualisation"
|
||||
"diskSize"
|
||||
];
|
||||
})
|
||||
];
|
||||
|
||||
in {
|
||||
options = {
|
||||
hyperv = {
|
||||
baseImageSize = mkOption {
|
||||
type = with types; either (enum [ "auto" ]) int;
|
||||
default = "auto";
|
||||
example = 2048;
|
||||
description = ''
|
||||
The size of the hyper-v base image in MiB.
|
||||
'';
|
||||
};
|
||||
vmDerivationName = mkOption {
|
||||
type = types.str;
|
||||
default = "nixos-hyperv-${config.system.nixos.label}-${pkgs.stdenv.hostPlatform.system}";
|
||||
|
@ -50,8 +34,6 @@ in
|
|||
};
|
||||
|
||||
config = {
|
||||
virtualisation.diskSize = lib.mkDefault (4 * 1024);
|
||||
|
||||
system.build.hypervImage = import ../../lib/make-disk-image.nix {
|
||||
name = cfg.vmDerivationName;
|
||||
postVM = ''
|
||||
|
@ -59,7 +41,7 @@ in
|
|||
rm $diskImage
|
||||
'';
|
||||
format = "raw";
|
||||
inherit (config.virtualisation) diskSize;
|
||||
diskSize = cfg.baseImageSize;
|
||||
partitionTableType = "efi";
|
||||
inherit config lib pkgs;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue