Skip to content

Commit

Permalink
modules/netboot: add system.build.image for new kexecTarball
Browse files Browse the repository at this point in the history
  • Loading branch information
phaer committed Nov 30, 2024
1 parent 4cd3d7a commit 118943e
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion nixos/modules/installer/netboot/netboot.nix
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down Expand Up @@ -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 =
Expand Down

0 comments on commit 118943e

Please sign in to comment.