Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)

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.

authored by Jörg Thalheim and committed by GitHub fa4eff9b 90aaa731

+6 -3
+6 -3
nixos/modules/virtualisation/google-compute-image.nix
··· 2 2 3 3 with lib; 4 4 let 5 - diskSize = "100G"; 5 + diskSize = "1G"; 6 6 in 7 7 { 8 - imports = [ ../profiles/headless.nix ../profiles/qemu-guest.nix ]; 8 + imports = [ ../profiles/headless.nix ../profiles/qemu-guest.nix ./grow-partition.nix ]; 9 9 10 10 # https://cloud.google.com/compute/docs/tutorials/building-images 11 11 networking.firewall.enable = mkDefault false; ··· 94 94 '' 95 95 ); 96 96 97 - fileSystems."/".label = "nixos"; 97 + fileSystems."/" = { 98 + device = "/dev/disk/by-label/nixos"; 99 + autoResize = true; 100 + }; 98 101 99 102 boot.kernelParams = [ "console=ttyS0" "panic=1" "boot.panic_on_fail" ]; 100 103 boot.initrd.kernelModules = [ "virtio_scsi" ];