···11-# This module automatically grows the root partition on Amazon EC2 HVM
22-# instances. This allows an instance to be created with a bigger root
33-# filesystem than provided by the AMI.
11+# This module automatically grows the root partition on virtual machines.
22+# This allows an instance to be created with a bigger root filesystem
33+# than provided by the machine image.
4455{ config, lib, pkgs, ... }:
6677{
88- config = lib.mkIf config.ec2.hvm {
88+99+ options = {
1010+1111+ virtualisation.growPartition = mkOption {
1212+ type = types.bool;
1313+ default = true;
1414+ };
1515+1616+ };
1717+1818+ config = mkIf config.virtualisation.growPartition {
1919+920 boot.initrd.extraUtilsCommands = ''
1021 copy_bin_and_libs ${pkgs.gawk}/bin/gawk
1122 copy_bin_and_libs ${pkgs.gnused}/bin/sed
···2435 udevadm settle
2536 fi
2637 '';
3838+2739 };
4040+2841}