Building Kexec tarball doesn't work (Wiki instructions)

Hi folks,

I wanted to try to install NixOS via kexec. I know I can use nixos-anywhere but I wanted to try to use kexec first manually.

I followed Wiki: Install NixOS on a Server With a Different Filesystem - NixOS Wiki

And on NixOS 23.05 I created the file as wiki suggests and run:

nix-build '<nixpkgs/nixos>' -A config.system.build.kexec_tarball -I nixos-config=./myconfig.nix -Q

But I got error:

error: The option `kexec' does not exist. Definition values:
       - In `/root/kexec.nix':
           {
             autoReboot = false;
           }

I looked at NixOS Search and there is no kexec.autoReboot option listed there.

Could you please tell me how to build the Kexec tarball?

Thank you.

I think I’d recommend “just using” nixos-anywhere, especially after watching today’s NixCon presentation on nixos-anywhere and disko but, if you’ve followed the instructions from the wiki, then:

If you’re still stuck, a great option is putting your own config in a git repo and sharing it so we can take a look.

Agreed.

I flaked it for you: GitHub - rudolfvesely/nixos-kexec: Related to https://discourse.nixos.org/t/building-kexec-tarball-doesnt-work-wiki-instructions/32854 with a shell script from https://github.com/cleverca22/nix-tests/blob/master/kexec/kexec.nix

1 Like