!atvIbxHoEqNcAIxYpN:nixos.org

NixOS AWS

64 Members
14 Servers

Load older messages


SenderMessageTime
6 Nov 2024
@tuxiqae:matrix.orgtuxiqae

My Disko config:

{
  disko.devices = {
    disk = {
      main = {
        device = "/dev/disk/by-id/some-disk-id";
        type = "disk";
        content = {
          type = "gpt";
          partitions = {
            ESP = {
              type = "EF00";
              size = "500M";
              content = {
                type = "filesystem";
                format = "vfat";
                mountpoint = "/boot";
                mountOptions = ["umask=0077"];
              };
            };
            root = {
              size = "100%";
              content = {
                type = "filesystem";
                format = "ext4";
                mountpoint = "/";
              };
            };
          };
        };
      };
    };
  };
}

I think it might be caused by the device but I'm not sure what to set it to

12:17:08
@tuxiqae:matrix.orgtuxiqae *

My Disko (default) config:

{
  disko.devices = {
    disk = {
      main = {
        device = "/dev/disk/by-id/some-disk-id";
        type = "disk";
        content = {
          type = "gpt";
          partitions = {
            ESP = {
              type = "EF00";
              size = "500M";
              content = {
                type = "filesystem";
                format = "vfat";
                mountpoint = "/boot";
                mountOptions = ["umask=0077"];
              };
            };
            root = {
              size = "100%";
              content = {
                type = "filesystem";
                format = "ext4";
                mountpoint = "/";
              };
            };
          };
        };
      };
    };
  };
}

I think it might be caused by the device but I'm not sure what to set it to

12:20:38
@arianvp:matrix.orgArianYou need to use import-snapshot13:05:13
@arianvp:matrix.orgArianAnd then register-image13:05:18
@arianvp:matrix.orgArianImport-image is b0rked. It only imports images that follow FHS13:05:33
@arianvp:matrix.orgArianDoesn't work with nixos13:05:36
@arianvp:matrix.orgArianYou can just use https://GitHub.com/nixos/amis upload_ami script13:05:55
@arianvp:matrix.orgArianIt does all of this13:05:58
@arianvp:matrix.orgArianOr use it as inspiration 13:06:05
@tuxiqae:matrix.orgtuxiqaeFML, wanted the ability to build a one-shot with Nix + Terranix that'll automatically provision the resources and start the instance13:11:41
@arianvp:matrix.orgArianYou can import snapshots with Terraform 13:15:56
@arianvp:matrix.orgArianAnd register the image too13:16:02
@arianvp:matrix.orgArianaws_ebs_snapshot_import resource13:16:35
@arianvp:matrix.orgArianCombine with aws_s3_bucket_item resource and aws_ami resource and you're done13:17:00
@arianvp:matrix.orgArianSomething like https://gist.github.com/arianvp/14dd40742c24894bb312ac3f5b90b43313:21:29
@tuxiqae:matrix.orgtuxiqaeYeah, but in order to import a snapshot I'd have to first provision a VM and then export that I wanted to just automatically create an image and upload that :(13:30:30
@arianvp:matrix.orgArianNo ?13:31:05
@tuxiqae:matrix.orgtuxiqae:O13:31:17
@arianvp:matrix.orgArianThis example is literally importing from local disk?13:31:35
@arianvp:matrix.orgArianJust like import image 13:31:38
@arianvp:matrix.orgArianSee line 413:32:07
@arianvp:matrix.orgArianThat's pointing to your local disk image you built13:32:28
@arianvp:matrix.orgArianYou upload the image to S3. Then import it as a snapshot. Then register the snapshot as an image13:32:45
@tuxiqae:matrix.orgtuxiqaeBut that'd mean that I'd have to provision a running image first, wouldn't it?14:00:26
@arianvp:matrix.orgArianYou just point that to your nix image build14:01:36
@arianvp:matrix.orgArianThis is just doing what upload-ami does but in terraform14:01:52
@arianvp:matrix.orgArianYou upload the image you built to s3. Import it to EBS. Then register the ebs snapshot as an image14:02:21
@arianvp:matrix.orgArianThere's no ec2 instances involved. 14:02:34
@arianvp:matrix.orgArianNot sure what you mean with "provision a running image'14:02:56
@tuxiqae:matrix.orgtuxiqaeAh, I see, I'll give it a look soon, thanks14:04:32

Show newer messages


Back to Room ListRoom Version: 10