Add NixOS ZFS EC2 AMI builder
This commit is contained in:
@@ -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;
|
||||
});
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user