diff --git a/formats/qcow.nix b/formats/qcow.nix index 1c5b505..4c50c6f 100644 --- a/formats/qcow.nix +++ b/formats/qcow.nix @@ -1,22 +1,34 @@ { config, lib, pkgs, modulesPath, ... }: { - fileSystems."/" = { - device = "/dev/disk/by-label/nixos"; - autoResize = true; - fsType = "ext4"; + options = { + virtualization.qemuImage.diskSize = mkOption { + type = types.int; + default = 8192; + description = '' + Size of disk image. Unit is MB. + ''; + }; }; - boot.growPartition = true; - boot.kernelParams = [ "console=ttyS0" ]; - boot.loader.grub.device = lib.mkDefault "/dev/vda"; - boot.loader.timeout = 0; + config = { + fileSystems."/" = { + device = "/dev/disk/by-label/nixos"; + autoResize = true; + fsType = "ext4"; + }; + + boot.growPartition = true; + boot.kernelParams = [ "console=ttyS0" ]; + boot.loader.grub.device = lib.mkDefault "/dev/vda"; + boot.loader.timeout = 0; - system.build.qcow = import "${toString modulesPath}/../lib/make-disk-image.nix" { - inherit lib config pkgs; - diskSize = 8192; - format = "qcow2"; + system.build.qcow = import "${toString modulesPath}/../lib/make-disk-image.nix" { + inherit lib config pkgs; + diskSize = config.virtualization.qemuImage.diskSize; + format = "qcow2"; + }; + + formatAttr = "qcow"; }; - - formatAttr = "qcow"; }