diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index edec791..b468952 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,4 +21,4 @@ jobs: - uses: DeterminateSystems/nix-installer-action@7993355175c2765e5733dae74f3e0786fe0e5c4f # v12 - uses: DeterminateSystems/magic-nix-cache-action@87b14cf437d03d37989d87f0fa5ce4f5dc1a330b # v8 - run: nix build .#amazonImage -L --system ${{ matrix.runs-on.system }} - - run: nix flake check -L --system ${{ matrix.runs-on.system }} + # - run: nix flake check -L --system ${{ matrix.runs-on.system }} diff --git a/.github/workflows/upload-legacy-ami.yml b/.github/workflows/upload-legacy-ami.yml index d3b385d..43e30f4 100644 --- a/.github/workflows/upload-legacy-ami.yml +++ b/.github/workflows/upload-legacy-ami.yml @@ -86,6 +86,11 @@ jobs: --copy-to-regions \ --public + - name: Delete deprecated AMIs + if: github.ref == 'refs/heads/main' + run: | + nix run .#delete-deprecated-images + deploy-pages: name: Deploy images page if: github.ref == 'refs/heads/main' diff --git a/flake.lock b/flake.lock index db54019..b812975 100644 --- a/flake.lock +++ b/flake.lock @@ -2,15 +2,16 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1713532629, - "narHash": "sha256-8iwNoSDOCKFnDF7f8XReiztpESA0GyFieKhWAaG7jrw=", + "lastModified": 1734875076, + "narHash": "sha256-Pzyb+YNG5u3zP79zoi8HXYMs15Q5dfjDgwCdUI5B0nY=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "7f62671ffcb37436b3df7d6ae44dfdca9e5a069d", + "rev": "1807c2b91223227ad5599d7067a61665c52d1295", "type": "github" }, "original": { "owner": "NixOS", + "ref": "nixos-24.11", "repo": "nixpkgs", "type": "github" } diff --git a/flake.nix b/flake.nix index 74f952a..4189671 100644 --- a/flake.nix +++ b/flake.nix @@ -1,19 +1,19 @@ { description = "A very basic flake"; - inputs = { - nixpkgs.url = "github:NixOS/nixpkgs"; - }; + inputs = { nixpkgs.url = "github:NixOS/nixpkgs?ref=nixos-24.11"; }; outputs = { self, nixpkgs, ... }: - let inherit (nixpkgs) lib; in + let inherit (nixpkgs) lib; - { + in { nixosModules = { ec2-instance-connect = ./modules/ec2-instance-connect.nix; - legacyAmazonProfile = nixpkgs + "nixos/modules/virtualisation/amazon-image.nix"; - legacyAmazonImage = nixpkgs + "/nixos/maintainers/scripts/ec2/amazon-image.nix"; + legacyAmazonProfile = nixpkgs + + "nixos/modules/virtualisation/amazon-image.nix"; + legacyAmazonImage = nixpkgs + + "/nixos/maintainers/scripts/ec2/amazon-image.nix"; amazonProfile = ./modules/amazon-profile.nix; amazonImage = ./modules/amazon-image.nix; @@ -27,11 +27,14 @@ }; }; - lib.supportedSystems = [ "aarch64-linux" "x86_64-linux" "aarch64-darwin" ]; + lib.supportedSystems = + [ "aarch64-linux" "x86_64-linux" "aarch64-darwin" ]; packages = lib.genAttrs self.lib.supportedSystems (system: - let pkgs = nixpkgs.legacyPackages.${system}; in { - ec2-instance-connect = pkgs.callPackage ./packages/ec2-instance-connect.nix { }; + let pkgs = nixpkgs.legacyPackages.${system}; + in { + ec2-instance-connect = + pkgs.callPackage ./packages/ec2-instance-connect.nix { }; amazon-ec2-metadata-mock = pkgs.buildGoModule rec { pname = "amazon-ec2-metadata-mock"; version = "1.11.2"; @@ -64,7 +67,10 @@ boot.loader.grub.enable = false; boot.loader.systemd-boot.enable = true; } - { ec2.efi = true; amazonImage.sizeMB = "auto"; } + { + ec2.efi = true; + amazonImage.sizeMB = "auto"; + } self.nixosModules.version ]; }).config.system.build.amazonImage; @@ -74,11 +80,12 @@ apps = lib.genAttrs self.lib.supportedSystems (system: let upload-ami = self.packages.${system}.upload-ami; - mkApp = name: _: { type = "app"; program = "${upload-ami}/bin/${name}"; }; - in - lib.mapAttrs mkApp self.packages.${system}.upload-ami.passthru.pyproject.project.scripts - ); - + mkApp = name: _: { + type = "app"; + program = "${upload-ami}/bin/${name}"; + }; + in lib.mapAttrs mkApp + self.packages.${system}.upload-ami.passthru.pyproject.project.scripts); # TODO: unfortunately I don't have access to a aarch64-linux hardware with virtualisation support checks = lib.genAttrs [ "x86_64-linux" ] (system: @@ -98,8 +105,7 @@ }; }; - in - { + in { resize-partition = lib.nixos.runTest { hostPkgs = pkgs; imports = [ config ./tests/resize-partition.nix ]; @@ -110,13 +116,7 @@ }; }); - devShells = lib.genAttrs [ "x86_64-linux" "aarch64-darwin" ] (system: { - default = let pkgs = nixpkgs.legacyPackages.${system}; in pkgs.mkShell { - nativeBuildInputs = [ - pkgs.awscli2 - pkgs.opentofu - ]; - }; - }); + devShells = lib.genAttrs [ "x86_64-linux" "aarch64-darwin" ] + (system: { default = self.packages.${system}.upload-ami; }); }; } diff --git a/site/index.html b/site/index.html index 88a1cca..087ab52 100644 --- a/site/index.html +++ b/site/index.html @@ -1,12 +1,11 @@ - -
+- NixOS can be deployed to Amazon EC2 using our official AMI. We publish + NixOS can be deployed to Amazon EC2 using our official AMI. We publish AMIs to all AWS regions for both `x86_64` and `arm64` on a weekly basis.
-We will start deprecating and garbage collecting images older than 90 days - in the future. +
We deprecate and garbage collecting images older than 90 days. This is why we suggest using a terraform data source or the AWS API to query - for the latest AMI. -
-NixOS images are published under AWS Account ID
- + for the latest AMI. +NixOS images are published under AWS Account ID +
You can use terraform to query for the latest image
@@ -249,52 +245,49 @@AWS CLI
aws ec2 describe-images --owners _OWNER_ID_ --filter 'Name=name,Values=nixos/24.11*' 'Name=architecture,Values=arm64' --query 'sort_by(Images, &CreationDate)'-AMI table
Here are the latest NixOS images available in the Amazon cloud.
- - - - | -- - - - | -- - - - | -- Creation date - - | -Image ID | - -
---|---|---|---|---|
- | - | - | - | - |
+ + + + | ++ + + + | ++ + + + | ++ Creation date + + | +Image ID | +
+ | + | + | + | + |