virtualisation/vmware-image: vmware.vmFileName -> image.fileName
This commit is contained in:
@@ -17,6 +17,23 @@ let
|
|||||||
];
|
];
|
||||||
|
|
||||||
in {
|
in {
|
||||||
|
imports = [
|
||||||
|
../image/file-options.nix
|
||||||
|
(lib.mkRenamedOptionModuleWith {
|
||||||
|
sinceRelease = 2505;
|
||||||
|
from = [
|
||||||
|
"virtualisation"
|
||||||
|
"vmware"
|
||||||
|
"vmFileName"
|
||||||
|
];
|
||||||
|
to = [
|
||||||
|
"image"
|
||||||
|
"fileName"
|
||||||
|
];
|
||||||
|
})
|
||||||
|
|
||||||
|
];
|
||||||
|
|
||||||
options = {
|
options = {
|
||||||
vmware = {
|
vmware = {
|
||||||
baseImageSize = lib.mkOption {
|
baseImageSize = lib.mkOption {
|
||||||
@@ -34,13 +51,6 @@ in {
|
|||||||
The name of the derivation for the VMWare appliance.
|
The name of the derivation for the VMWare appliance.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
vmFileName = lib.mkOption {
|
|
||||||
type = lib.types.str;
|
|
||||||
default = "nixos-${config.system.nixos.label}-${pkgs.stdenv.hostPlatform.system}.vmdk";
|
|
||||||
description = ''
|
|
||||||
The file name of the VMWare appliance.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
vmSubformat = lib.mkOption {
|
vmSubformat = lib.mkOption {
|
||||||
type = lib.types.enum subformats;
|
type = lib.types.enum subformats;
|
||||||
default = "monolithicSparse";
|
default = "monolithicSparse";
|
||||||
@@ -56,10 +66,14 @@ in {
|
|||||||
};
|
};
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
|
system.nixos.tags = [ "vmware" ];
|
||||||
|
image.extension = "vmdk";
|
||||||
|
system.build.image = config.system.build.vmwareImage;
|
||||||
system.build.vmwareImage = import ../../lib/make-disk-image.nix {
|
system.build.vmwareImage = import ../../lib/make-disk-image.nix {
|
||||||
name = cfg.vmDerivationName;
|
name = cfg.vmDerivationName;
|
||||||
|
baseName = config.image.baseName;
|
||||||
postVM = ''
|
postVM = ''
|
||||||
${pkgs.vmTools.qemu}/bin/qemu-img convert -f raw -o compat6=${boolToStr cfg.vmCompat6},subformat=${cfg.vmSubformat} -O vmdk $diskImage $out/${cfg.vmFileName}
|
${pkgs.vmTools.qemu}/bin/qemu-img convert -f raw -o compat6=${boolToStr cfg.vmCompat6},subformat=${cfg.vmSubformat} -O vmdk $diskImage $out/${config.image.fileName}
|
||||||
rm $diskImage
|
rm $diskImage
|
||||||
'';
|
'';
|
||||||
format = "raw";
|
format = "raw";
|
||||||
|
|||||||
Reference in New Issue
Block a user