nix: add runner images outputs
This commit is contained in:
parent
2e5fb0880f
commit
7719b0b763
5 changed files with 232 additions and 1 deletions
81
flake.nix
81
flake.nix
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue