Files
nixos-zfs-ec2-ami/flake.nix
T
2026-06-20 11:28:38 -07:00

37 lines
960 B
Nix

{
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;
});
};
}