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.
This commit is contained in:
Jörg Thalheim 2017-04-10 12:01:53 +02:00 committed by GitHub
commit fa4eff9b52

View File

@ -2,10 +2,10 @@
with lib; with lib;
let let
diskSize = "100G"; diskSize = "1G";
in 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 # https://cloud.google.com/compute/docs/tutorials/building-images
networking.firewall.enable = mkDefault false; 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.kernelParams = [ "console=ttyS0" "panic=1" "boot.panic_on_fail" ];
boot.initrd.kernelModules = [ "virtio_scsi" ]; boot.initrd.kernelModules = [ "virtio_scsi" ];