0
0
Fork 0
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:
Martin Weinelt 2024-09-10 03:12:55 +02:00 committed by GitHub
parent 757e0a34b7
commit 4cec81a995
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 1293 additions and 1759 deletions

View file

@ -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;
};