forked from the-distro/infra
build netboot files from hydra
This commit is contained in:
parent
6dc424dd43
commit
1cbf286f18
|
@ -114,7 +114,7 @@
|
||||||
public01.imports = commonModules ++ [ ./hosts/public01 ];
|
public01.imports = commonModules ++ [ ./hosts/public01 ];
|
||||||
} // builders;
|
} // builders;
|
||||||
|
|
||||||
hydraJobs = builtins.mapAttrs (n: v: v.config.system.build.toplevel) self.nixosConfigurations;
|
hydraJobs = builtins.mapAttrs (n: v: v.config.system.build.netbootDir or v.config.system.build.toplevel) self.nixosConfigurations;
|
||||||
buildbotJobs = builtins.mapAttrs (_: v: v.config.system.build.toplevel) self.nixosConfigurations;
|
buildbotJobs = builtins.mapAttrs (_: v: v.config.system.build.toplevel) self.nixosConfigurations;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ pkgs, lib, config, ... }:
|
{ pkgs, lib, config, extendModules, ... }:
|
||||||
let
|
let
|
||||||
cfg = config.bagel.baremetal.builders;
|
cfg = config.bagel.baremetal.builders;
|
||||||
in
|
in
|
||||||
|
@ -177,6 +177,39 @@ in
|
||||||
|
|
||||||
environment.systemPackages = [ pkgs.ipmitool ];
|
environment.systemPackages = [ pkgs.ipmitool ];
|
||||||
|
|
||||||
|
system.build = lib.mkIf cfg.netboot {
|
||||||
|
netbootVariant = extendModules {
|
||||||
|
modules = [
|
||||||
|
(
|
||||||
|
{ modulesPath, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [ (modulesPath + "/installer/netboot/netboot.nix") ];
|
||||||
|
}
|
||||||
|
)
|
||||||
|
];
|
||||||
|
};
|
||||||
|
netbootDir = let
|
||||||
|
kernelTarget = pkgs.stdenv.hostPlatform.linux-kernel.target;
|
||||||
|
build = config.system.build.netbootVariant.config.system.build;
|
||||||
|
in
|
||||||
|
pkgs.symlinkJoin {
|
||||||
|
name = "netboot";
|
||||||
|
paths = [
|
||||||
|
build.netbootRamdisk
|
||||||
|
build.kernel
|
||||||
|
build.netbootIpxeScript
|
||||||
|
];
|
||||||
|
postBuild = ''
|
||||||
|
mkdir -p $out/nix-support
|
||||||
|
echo "file ${kernelTarget} ${build.kernel}/${kernelTarget}" >> $out/nix-support/hydra-build-products
|
||||||
|
echo "file initrd ${build.netbootRamdisk}/initrd" >> $out/nix-support/hydra-build-products
|
||||||
|
echo "file ipxe ${build.netbootIpxeScript}/netboot.ipxe" >> $out/nix-support/hydra-build-products
|
||||||
|
'';
|
||||||
|
preferLocalBuild = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
system.stateVersion = "24.05";
|
system.stateVersion = "24.05";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue