git.iko.soy/typeable/nixpkgs
on master help sign in
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.

commitfa4eff9b52a25db2949b8b7dc16fb7ee5334ca9a authorJörg Thalheim <Mic92@users.noreply.github.com> dateMon 10 Apr 2017, 12:01 (10 years ago) parent90aaa7372ec884
1 file changed+6−3
nixos/modules/virtualisation/google-compute-image.nix+6−3
nixos/modules/virtualisation/google-compute-image.nix+6−3
@@ -2,10 +2,10 @@
22
33with lib;
44let
5− diskSize = "100G";
5+ diskSize = "1G";
66in
77{
8− imports = [ ../profiles/headless.nix ../profiles/qemu-guest.nix ];
8+ imports = [ ../profiles/headless.nix ../profiles/qemu-guest.nix ./grow-partition.nix ];
99
1010 # https://cloud.google.com/compute/docs/tutorials/building-images
1111 networking.firewall.enable = mkDefault false;
@@ -94,7 +94,10 @@ in
9494 ''
9595 );
9696
97− fileSystems."/".label = "nixos";
97+ fileSystems."/" = {
98+ device = "/dev/disk/by-label/nixos";
99+ autoResize = true;
100+ };
98101
99102 boot.kernelParams = [ "console=ttyS0" "panic=1" "boot.panic_on_fail" ];
100103 boot.initrd.kernelModules = [ "virtio_scsi" ];