Skip to content

Instantly share code, notes, and snippets.

@cransom
Created September 29, 2022 23:06
Show Gist options
  • Save cransom/48d03590c7a65497b98114b560523e5d to your computer and use it in GitHub Desktop.
Save cransom/48d03590c7a65497b98114b560523e5d to your computer and use it in GitHub Desktop.
/* $ time aws ec2 register-image --output text --region us-east-2 --name "coldsnap-test-staging-10" --architecture x86_64 --ena-support --sriov-net-support simple --virtualization-type hvm --block-device-mappings "[ { \"DeviceName\": \"/dev/sda1\", \"Ebs\": { \"SnapshotId\": \"$(coldsnap --region us-east-2 upload --wait /nix/store/nngyyq6j149fj98nq8ds8v10c31ksqdx-routing-disk-image/nixos.img)\" } } ]" --query 'ImageId' --root-device-name /dev/sda1
ami-0cc753b15aaf9b198
real 0m31.255s
user 0m24.215s
sys 0m7.335s
$ du -chs /nix/store/nngyyq6j149fj98nq8ds8v10c31ksqdx-routing-disk-image/nixos.img
2.5G /nix/store/nngyyq6j149fj98nq8ds8v10c31ksqdx-routing-disk-image/nixos.img
2.5G total
*/
{ lib, fetchFromGitHub, rustPlatform, openssl, pkg-config }:
rustPlatform.buildRustPackage rec {
pname = "coldsnap";
version = "v0.4.1";
nativeBuildInputs = [ pkg-config ];
propagatedBuildInputs = [ openssl ];
src = fetchFromGitHub {
owner = "awslabs";
repo = pname;
rev = version;
sha256 = "sha256-0NSRD+OZOhKR0l37BE/5T+u+ictGjzdYgqTTiB9+uVo=";
};
cargoSha256 = "sha256-txnZpqxRgr5k8zgquYo5FT9iidvPkm6EVSLuU1UhbPQ=";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment