Home Explore Blog Models CI



nixpkgs

nixos/maintainers/scripts/ec2/README.md
9957275edb66f3e531098171eafd4c035c60fc2f2ebdbf6f000000030000047c
# Amazon images

AMIs are regularly uploaded from Hydra. This automation lives in
https://github.com/NixOS/amis


## How to upload an AMI for testing

If you want to upload an AMI from changes in a local nixpkgs checkout.

```bash
nix-build nixos/release.nix -A amazonImage

export AWS_REGION=us-west-2
export AWS_PROFILE=my-profile
nix run nixpkgs#upload-ami -- --image-info ./result/nix-support/image-info.json
```

## How to build your own NixOS config into an AMI

Use `nixos-rebuild build-image` as follows:

```bash
NIXOS_CONFIG="$(pwd)/my-config.nix" nixos-rebuild build-image --image-variant amazon

export AWS_REGION=us-west-2
export AWS_PROFILE=my-profile
nix run github:NixOS/amis#upload-ami -- --image-info ./result/nix-support/image-info.json
```

## Roadmap

* @arianvp is planning to drop zfs support unless someone else picks it up
* @arianvp is planning to rewrite the image builder to use the repart-based image builder.
* @arianvp is planning to perhaps rewrite `upload-ami` to use coldnsap
* @arianvp is planning to move `upload-ami` tooling into nixpkgs once it has stabilized. And only keep the Github Action in separate repo

Chunks
307e31d8 (1st chunk of `nixos/maintainers/scripts/ec2/README.md`)
Title: NixOS Amazon Machine Images (AMIs) Workflow and Roadmap
Summary
This document details the management of NixOS Amazon Machine Images (AMIs), which are regularly uploaded from Hydra using automation found at `https://github.com/NixOS/amis`. It provides step-by-step instructions for users to upload an AMI for testing from local `nixpkgs` changes and to build and upload their own custom NixOS configuration into an AMI. The roadmap outlines future plans, including the potential removal of ZFS support, a rewrite of the image builder using `repart`, a possible rewrite of `upload-ami` to use `coldnsap`, and the eventual integration of `upload-ami` tooling into `nixpkgs`.