From 118943e88c2480f2595d9610c42309806931ce67 Mon Sep 17 00:00:00 2001 From: phaer Date: Mon, 18 Nov 2024 14:42:29 +0100 Subject: [PATCH] modules/netboot: add system.build.image for new kexecTarball --- nixos/modules/installer/netboot/netboot.nix | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/nixos/modules/installer/netboot/netboot.nix b/nixos/modules/installer/netboot/netboot.nix index adcc10316fea13..a3e94384fc862f 100644 --- a/nixos/modules/installer/netboot/netboot.nix +++ b/nixos/modules/installer/netboot/netboot.nix @@ -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 =