virtualisation/hyperv-image: hyperv.vmFileName -> image.fileName

phaer a230d522 6d50a8c5

Changed files
+18 -8
nixos
modules
virtualisation
+18 -8
nixos/modules/virtualisation/hyperv-image.nix
···
imports = [
./disk-size-option.nix
+
../image/file-options.nix
(lib.mkRenamedOptionModuleWith {
sinceRelease = 2411;
from = [
···
to = [
"virtualisation"
"diskSize"
+
];
+
})
+
(lib.mkRenamedOptionModuleWith {
+
sinceRelease = 2505;
+
from = [
+
"virtualisation"
+
"hyperv"
+
"vmFileName"
+
];
+
to = [
+
"image"
+
"fileName"
];
})
];
···
The name of the derivation for the hyper-v appliance.
'';
};
-
vmFileName = mkOption {
-
type = types.str;
-
default = "nixos-${config.system.nixos.label}-${pkgs.stdenv.hostPlatform.system}.vhdx";
-
description = ''
-
The file name of the hyper-v appliance.
-
'';
-
};
};
};
···
# to avoid breaking existing configs using that.
virtualisation.diskSize = lib.mkOverride 1490 (4 * 1024);
+
system.nixos.tags = [ "hyperv" ];
+
image.extension = "vhdx";
+
system.build.image = config.system.build.hypervImage;
system.build.hypervImage = import ../../lib/make-disk-image.nix {
name = cfg.vmDerivationName;
+
baseName = config.image.baseName;
postVM = ''
-
${pkgs.vmTools.qemu}/bin/qemu-img convert -f raw -o subformat=dynamic -O vhdx $diskImage $out/${cfg.vmFileName}
+
${pkgs.vmTools.qemu}/bin/qemu-img convert -f raw -o subformat=dynamic -O vhdx $diskImage $out/${config.image.fileName}
rm $diskImage
'';
format = "raw";