- get rid of rec by using recursive let
- do not use python3.pkgs (oh that splicing dark magic)
- get rid of nested with
- set meta.mainProgram
- adopted by AndersonTorres
Without sort-keys specified on entries, the entries are sorted only by
file name (in decreasing order, so starting at the end of the alphabet!),
without taking any other fields into account (see
[the boot loader specification reference][1]).
Moreover, entries without a sort-key are always ordered after all
entries with a sort-key, so by not adding a sort-key to the NixOS ones,
we cannot add a sort-key to any other entry while keeping it below the
NixOS entries.
So currently we have options to set the file names for additional entries like
memtest and netbootxyz.
However, as mentioned above, the sorting by file name is not very intuitive and
actually sorts in the opposite order of what is currently mentioned in the option
descriptions.
With this commit, we set a configurable sort-key on all NixOS entries,
and add options for setting the sort-keys for the memtest and netbootxyz
entries.
The sorting by sort-key is more intuitive (it starts at the start of the
alphabet) and also takes into account the machine-id and version for entries
with identical sort-keys.
We use a bootspec extension to store the sort keys, which allows us to
redefine the sort key for individual specialisations without needing any
special casing.
[1]: https://uapi-group.org/specifications/specs/boot_loader_specification/#sorting
Without the change the test build attempt fails the evaluation as:
$ nix build --no-link -f. distrobuilder.tests.incus
error: attribute 'container' missing
at pkgs/tools/virtualization/distrobuilder/default.nix:54:19:
53| passthru = {
54| tests.incus = nixosTests.incus.container;
| ^
This started happening after `container` test was split in two in
c607e70f70 "nixosTests.incus: add test with old and new init".
The qemu module shouldn't implicitly (and for all architectures) enable
SSM when enabling Secure Boot.
Additionally, this breaks aarch64 Secure Boot tests because this module
doesn't use the right machine type for anything but X86.
Someone seems to believe that SMM implies x86, this is wrong.
aarch64 supports SMM too, see upstream QEMU code.
The proper way to do this is to signal support via QEMU itself, this is something
we cannot do because we have no way to communicate QEMU support itself (yet?).
Signed-off-by: Raito Bezarius <masterancpp@gmail.com>
Now that the previous commit removed all the .display()'s that were
previously necessary for PathBuf's, but now aren't for RelativePathBuf,
we can also inline the format! arguments