diff options
author | Jörg Thalheim <Mic92@users.noreply.github.com> | 2017-04-10 12:01:53 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-10 12:01:53 +0200 |
commit | fa4eff9b52a25db2949b8b7dc16fb7ee5334ca9a (patch) | |
tree | f6aea3d17285209d765795caaf0c78f8168129e4 /nixos/modules/virtualisation | |
parent | 90aaa7319e9d90b2749e76c03c3c27f4524e540f (diff) | |
parent | 72ec884cc65c2bfd799376a80868994f24621b1b (diff) | |
download | nixlib-fa4eff9b52a25db2949b8b7dc16fb7ee5334ca9a.tar nixlib-fa4eff9b52a25db2949b8b7dc16fb7ee5334ca9a.tar.gz nixlib-fa4eff9b52a25db2949b8b7dc16fb7ee5334ca9a.tar.bz2 nixlib-fa4eff9b52a25db2949b8b7dc16fb7ee5334ca9a.tar.lz nixlib-fa4eff9b52a25db2949b8b7dc16fb7ee5334ca9a.tar.xz nixlib-fa4eff9b52a25db2949b8b7dc16fb7ee5334ca9a.tar.zst nixlib-fa4eff9b52a25db2949b8b7dc16fb7ee5334ca9a.zip |
Merge pull request #24360 from clefru/gce-image-shrink-on-master
Shrink GCE bootstrap image to minimum size, and auto-expand it to actual size on first boot.
Diffstat (limited to 'nixos/modules/virtualisation')
-rw-r--r-- | nixos/modules/virtualisation/google-compute-image.nix | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/nixos/modules/virtualisation/google-compute-image.nix b/nixos/modules/virtualisation/google-compute-image.nix index a3dd3bd55d14..5673d55b3394 100644 --- a/nixos/modules/virtualisation/google-compute-image.nix +++ b/nixos/modules/virtualisation/google-compute-image.nix @@ -2,10 +2,10 @@ with lib; let - diskSize = "100G"; + diskSize = "1G"; in { - imports = [ ../profiles/headless.nix ../profiles/qemu-guest.nix ]; + imports = [ ../profiles/headless.nix ../profiles/qemu-guest.nix ./grow-partition.nix ]; # https://cloud.google.com/compute/docs/tutorials/building-images networking.firewall.enable = mkDefault false; @@ -94,7 +94,10 @@ in '' ); - fileSystems."/".label = "nixos"; + fileSystems."/" = { + device = "/dev/disk/by-label/nixos"; + autoResize = true; + }; boot.kernelParams = [ "console=ttyS0" "panic=1" "boot.panic_on_fail" ]; boot.initrd.kernelModules = [ "virtio_scsi" ]; |