mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-13 21:50:33 +03:00
nixos/systemd-boot: create boot entries for specialisations
Some specialisations (such as those which affect various boot-time attributes) cannot be switched to at runtime. This allows picking the specialisation at boot time.
This commit is contained in:
parent
052231cf79
commit
13fad0f81b
2 changed files with 73 additions and 23 deletions
|
@ -39,6 +39,29 @@ in
|
|||
'';
|
||||
};
|
||||
|
||||
# Check that specialisations create corresponding boot entries.
|
||||
specialisation = makeTest {
|
||||
name = "systemd-boot-specialisation";
|
||||
meta.maintainers = with pkgs.stdenv.lib.maintainers; [ lukegb ];
|
||||
|
||||
machine = { pkgs, lib, ... }: {
|
||||
imports = [ common ];
|
||||
specialisation.something.configuration = {};
|
||||
};
|
||||
|
||||
testScript = ''
|
||||
machine.start()
|
||||
machine.wait_for_unit("multi-user.target")
|
||||
|
||||
machine.succeed(
|
||||
"test -e /boot/loader/entries/nixos-generation-1-specialisation-something.conf"
|
||||
)
|
||||
machine.succeed(
|
||||
"grep -q 'title NixOS (something)' /boot/loader/entries/nixos-generation-1-specialisation-something.conf"
|
||||
)
|
||||
'';
|
||||
};
|
||||
|
||||
# Boot without having created an EFI entry--instead using default "/EFI/BOOT/BOOTX64.EFI"
|
||||
fallback = makeTest {
|
||||
name = "systemd-boot-fallback";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue