nix: add runner images outputs

This commit is contained in:
every.channel 2026-02-17 02:00:26 -08:00
parent 2e5fb0880f
commit 7719b0b763
No known key found for this signature in database
5 changed files with 232 additions and 1 deletions

View file

@ -12,10 +12,89 @@
let
nixosModules = rec {
ec-node = import ./nix/modules/ec-node.nix;
ec-runner = import ./nix/modules/ec-runner.nix;
default = ec-node;
};
in
{ inherit nixosModules; }
{
inherit nixosModules;
nixosConfigurations =
let
mkRunner = system: extraModules:
nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = { inherit self; };
modules = [
./nix/nixos/ec-runner.nix
] ++ extraModules;
};
in
{
# Base runner system (for normal installs).
ec-runner-aarch64 = mkRunner "aarch64-linux" [ ];
ec-runner-x86_64 = mkRunner "x86_64-linux" [ ];
# Netboot artifacts (iPXE/PXE).
ec-runner-aarch64-netboot = mkRunner "aarch64-linux" [
({ modulesPath, ... }: {
imports = [ (modulesPath + "/installer/netboot/netboot-minimal.nix") ];
})
({ config, pkgs, ... }: {
# Convenience output dir: { kernel, initrd, netboot.ipxe }.
system.build.netboot = pkgs.linkFarm "ec-runner-netboot" [
{
name = "kernel";
path = "${config.system.build.kernel}/${config.system.boot.loader.kernelFile}";
}
{
name = "initrd";
path = "${config.system.build.netbootRamdisk}/initrd";
}
{
name = "netboot.ipxe";
path = "${config.system.build.netbootIpxeScript}/netboot.ipxe";
}
];
})
];
ec-runner-x86_64-netboot = mkRunner "x86_64-linux" [
({ modulesPath, ... }: {
imports = [ (modulesPath + "/installer/netboot/netboot-minimal.nix") ];
})
({ config, pkgs, ... }: {
system.build.netboot = pkgs.linkFarm "ec-runner-netboot" [
{
name = "kernel";
path = "${config.system.build.kernel}/${config.system.boot.loader.kernelFile}";
}
{
name = "initrd";
path = "${config.system.build.netbootRamdisk}/initrd";
}
{
name = "netboot.ipxe";
path = "${config.system.build.netbootIpxeScript}/netboot.ipxe";
}
];
})
];
# Installer ISO (primarily for x86_64 bring-up).
ec-runner-x86_64-iso = mkRunner "x86_64-linux" [
({ modulesPath, ... }: {
imports = [ (modulesPath + "/installer/cd-dvd/installation-cd-minimal.nix") ];
})
];
# aarch64 SD image (useful for quick ARM bring-up and as a "real image" build target).
ec-runner-aarch64-sdimage = mkRunner "aarch64-linux" [
({ modulesPath, ... }: {
imports = [ (modulesPath + "/installer/sd-card/sd-image-aarch64.nix") ];
})
];
};
}
// flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {