I’ve got a Cloudformation stack that provisions webserver using the following:
WebServer:
Type: AWS::EC2::Instance
Properties:
KeyName: !Ref KeyName
ImageId: ami-030296bb256764655
InstanceType: t3.medium
SecurityGroupIds:
- !Ref WebServerSecurityGroup1
SubnetId: !Ref PublicSubnet2
BlockDeviceMappings:
- DeviceName: /dev/sda1
Ebs:
VolumeSize: 120
UserData:
Fn::Base64:
Fn::Sub: |
{
imports = [ <nixpkgs/nixos/modules/virtualisation/amazon-image.nix> ];
ec2.hvm = true;
swapDevices = [{
device = "/var/swap";
size = 1024 * 16;
}];
nix = {
gc = {
automatic = true;
dates = "05:15";
};
binaryCaches = [
"https://cache.nixos.org"
"http://hydra.foo.org:5000"
];
binaryCachePublicKeys = [ "foo" ];
};
}
Tags:
- Key: Name
Value: !Sub "foo-${Stage}"
Much to my surprise, when I ssh as root to this machine, df -h
reports:
# df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 195M 0 195M 0% /dev
tmpfs 1.9G 0 1.9G 0% /dev/shm
tmpfs 971M 3.4M 968M 1% /run
tmpfs 1.9G 360K 1.9G 1% /run/wrappers
/dev/disk/by-label/nixos 3.0G 3.0G 0 100% /
tmpfs 1.9G 0 1.9G 0% /sys/fs/cgroup
tmpfs 389M 0 389M 0% /run/user/0
What’s the correct way to provision this such that nix uses the the /dev/sda1
devince with 120G?