···1-# This module automatically grows the root partition on Amazon EC2 HVM
2-# instances. This allows an instance to be created with a bigger root
3-# filesystem than provided by the AMI.
45{ config, lib, pkgs, ... }:
67{
8- config = lib.mkIf config.ec2.hvm {
000000000009 boot.initrd.extraUtilsCommands = ''
10 copy_bin_and_libs ${pkgs.gawk}/bin/gawk
11 copy_bin_and_libs ${pkgs.gnused}/bin/sed
···24 udevadm settle
25 fi
26 '';
027 };
028}
···1+# This module automatically grows the root partition on virtual machines.
2+# This allows an instance to be created with a bigger root filesystem
3+# than provided by the machine image.
45{ config, lib, pkgs, ... }:
67{
8+9+ options = {
10+11+ virtualisation.growPartition = mkOption {
12+ type = types.bool;
13+ default = true;
14+ };
15+16+ };
17+18+ config = mkIf config.virtualisation.growPartition {
19+20 boot.initrd.extraUtilsCommands = ''
21 copy_bin_and_libs ${pkgs.gawk}/bin/gawk
22 copy_bin_and_libs ${pkgs.gnused}/bin/sed
···35 udevadm settle
36 fi
37 '';
38+39 };
40+41}