Add NixOS ZFS EC2 AMI builder

This commit is contained in:
Timothy J. Aveni
2026-06-20 11:28:38 -07:00
commit b2e4b7fcaa
9 changed files with 681 additions and 0 deletions
+36
View File
@@ -0,0 +1,36 @@
{
description = "Project-agnostic NixOS EC2 AMI with ZFS /nix support";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};
outputs = { self, nixpkgs, ... }:
let
supportedSystems = [ "aarch64-linux" "x86_64-linux" ];
forAllSystems = f:
nixpkgs.lib.genAttrs supportedSystems (system: f system);
mkConfig = system:
nixpkgs.lib.nixosSystem {
inherit system;
modules = [
./nixos/baseline.nix
];
};
in
{
nixosConfigurations = {
baseline-aarch64-linux = mkConfig "aarch64-linux";
baseline-x86_64-linux = mkConfig "x86_64-linux";
};
packages = forAllSystems (system:
let
config = self.nixosConfigurations."baseline-${system}".config;
in
{
rootImage = config.system.build.images.amazon;
systemClosure = config.system.build.toplevel;
});
};
}