fd8bca45c9
Evaluation error introduced in 599c4df46a90c7415a6cc0689f0b23d22e7fdb67. There is only a "platformS" attribute in kexectools.meta, so let's use this and from the code in the kexec module it operates on a list, matching the corresponding platforms, so this seems to be the attribute the original author intended. Tested by building nixos/tests/kexec.nix on x86_64-linux and while it evaluates now, the test still fails by timing out shortly after the kexec: machine: waiting for the VM to finish booting machine# Cannot find the ESP partition mount point. This however seems to be an unrelated issue and was also the case before the commit mentioned above. Signed-off-by: aszlig <aszlig@nix.build> Cc: @edolstra, @dezgeg
23 lines
755 B
Nix
23 lines
755 B
Nix
{ pkgs, lib, ... }:
|
|
|
|
{
|
|
config = lib.mkIf (lib.any (lib.meta.platformMatch pkgs.stdenv.hostPlatform) pkgs.kexectools.meta.platforms) {
|
|
environment.systemPackages = [ pkgs.kexectools ];
|
|
|
|
systemd.services."prepare-kexec" =
|
|
{ description = "Preparation for kexec";
|
|
wantedBy = [ "kexec.target" ];
|
|
before = [ "systemd-kexec.service" ];
|
|
unitConfig.DefaultDependencies = false;
|
|
serviceConfig.Type = "oneshot";
|
|
path = [ pkgs.kexectools ];
|
|
script =
|
|
''
|
|
p=$(readlink -f /nix/var/nix/profiles/system)
|
|
if ! [ -d $p ]; then exit 1; fi
|
|
exec kexec --load $p/kernel --initrd=$p/initrd --append="$(cat $p/kernel-params) init=$p/init"
|
|
'';
|
|
};
|
|
};
|
|
}
|