modules/netboot: add system.build.image for new kexecTarball

This commit is contained in:
phaer 2024-11-18 14:42:29 +01:00
parent 53e68e04f2
commit 63d0a4ea61

View file

@ -1,11 +1,15 @@
# This module creates netboot media containing the given NixOS
# configuration.
{ config, lib, pkgs, ... }:
{ config, lib, pkgs, modulesPath, ... }:
with lib;
{
imports = [
../../image/file-options.nix
];
options = {
netboot.squashfsCompression = mkOption {
@ -129,6 +133,21 @@ with lib;
}
];
image.extension = "tar.xz";
image.filePath = "tarball/${config.image.fileName}";
system.nixos.tags = [ "kexec" ];
system.build.image = config.system.build.kexecTarball;
system.build.kexecTarball = pkgs.callPackage "${toString modulesPath}/../lib/make-system-tarball.nix" {
fileName = config.image.baseName;
storeContents = [
{
object = config.system.build.kexecScript;
symlink = "/kexec_nixos";
}
];
contents = [];
};
boot.loader.timeout = 10;
boot.postBootCommands = ''