···
[ (mkRenamedOptionModule [ "boot" "loader" "gummiboot" "enable" ] [ "boot" "loader" "systemd-boot" "enable" ])
+
(lib.mkChangedOptionModule
+
[ "boot" "loader" "systemd-boot" "memtest86" "entryFilename" ]
+
[ "boot" "loader" "systemd-boot" "memtest86" "sortKey" ]
+
(config: lib.strings.removeSuffix ".conf" config.boot.loader.systemd-boot.memtest86.entryFilename)
+
(lib.mkChangedOptionModule
+
[ "boot" "loader" "systemd-boot" "netbootxyz" "entryFilename" ]
+
[ "boot" "loader" "systemd-boot" "netbootxyz" "sortKey" ]
+
(config: lib.strings.removeSuffix ".conf" config.boot.loader.systemd-boot.netbootxyz.entryFilename)
options.boot.loader.systemd-boot = {
···
+
The sort key used for the NixOS bootloader entries.
+
This key determines sorting relative to non-NixOS entries.
+
See also https://uapi-group.org/specifications/specs/boot_loader_specification/#sorting
+
This option can also be used to control the sorting of NixOS specialisations.
+
By default, specialisations inherit the sort key of their parent generation
+
and will have the same value for both the sort-key and the version (i.e. the generation number),
+
systemd-boot will therefore sort them based on their file name, meaning that
+
in your boot menu you will have each main generation directly followed by
+
its specialisations sorted alphabetically by their names.
+
If you want a different ordering for a specialisation, you can override
+
its sort-key which will cause the specialisation to be uncoupled from its
+
parent generation. It will then be sorted by its new sort-key just like
+
The sort-key is stored in the generation's bootspec, which means that
+
generations keep their sort-keys even if the original definition of the
+
generation was removed from the NixOS configuration.
+
It also means that updating the sort-key will only affect new generations,
+
while old ones will keep the sort-key that they were originally built with.
···
+
default = "o_memtest86";
description = lib.mdDoc ''
+
`systemd-boot` orders the menu entries by their sort keys,
so if you want something to appear after all the NixOS entries,
it should start with {file}`o` or onwards.
+
See also {option}`boot.loader.systemd-boot.sortKey`.
···
+
default = "o_netbootxyz";
description = lib.mdDoc ''
+
`systemd-boot` orders the menu entries by their sort keys,
so if you want something to appear after all the NixOS entries,
it should start with {file}`o` or onwards.
+
See also {option}`boot.loader.systemd-boot.sortKey`.
···
efi /efi/memtest86/memtest.efi
description = lib.mdDoc ''
···
Each attribute name denotes the destination file name,
and the corresponding attribute value is the contents of the entry.
+
To control the ordering of the entry in the boot menu, use the sort-key
+
https://uapi-group.org/specifications/specs/boot_loader_specification/#sorting
+
and {option}`boot.loader.systemd-boot.sortKey`.
···
boot.loader.systemd-boot.extraEntries = mkMerge [
(mkIf cfg.memtest86.enable {
efi /efi/memtest86/memtest.efi
+
sort-key ${cfg.memtest86.sortKey}
(mkIf cfg.netbootxyz.enable {
efi /efi/netbootxyz/netboot.xyz.efi
+
sort-key ${cfg.netbootxyz.sortKey}
+
boot.bootspec.extensions."org.nixos.systemd-boot" = {
+
inherit (config.boot.loader.systemd-boot) sortKey;
build.installBootLoader = finalSystemdBootBuilder;