mirror of
https://github.com/nix-community/nixos-generators.git
synced 2024-08-16 23:51:00 +03:00
qcow: add virtualization.qemuImage.diskSize option
This commit is contained in:
parent
d72adc1a0a
commit
3cd90f3cfc
@ -1,22 +1,34 @@
|
|||||||
{ config, lib, pkgs, modulesPath, ... }:
|
{ config, lib, pkgs, modulesPath, ... }:
|
||||||
{
|
{
|
||||||
fileSystems."/" = {
|
options = {
|
||||||
device = "/dev/disk/by-label/nixos";
|
virtualization.qemuImage.diskSize = mkOption {
|
||||||
autoResize = true;
|
type = types.int;
|
||||||
fsType = "ext4";
|
default = 8192;
|
||||||
|
description = ''
|
||||||
|
Size of disk image. Unit is MB.
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
boot.growPartition = true;
|
config = {
|
||||||
boot.kernelParams = [ "console=ttyS0" ];
|
fileSystems."/" = {
|
||||||
boot.loader.grub.device = lib.mkDefault "/dev/vda";
|
device = "/dev/disk/by-label/nixos";
|
||||||
boot.loader.timeout = 0;
|
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" {
|
system.build.qcow = import "${toString modulesPath}/../lib/make-disk-image.nix" {
|
||||||
inherit lib config pkgs;
|
inherit lib config pkgs;
|
||||||
diskSize = 8192;
|
diskSize = config.virtualization.qemuImage.diskSize;
|
||||||
format = "qcow2";
|
format = "qcow2";
|
||||||
|
};
|
||||||
|
|
||||||
|
formatAttr = "qcow";
|
||||||
};
|
};
|
||||||
|
|
||||||
formatAttr = "qcow";
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user