3
0
Fork 0
forked from mirrors/nixpkgs

lib/systems/default.nix: add efiArch suffixes

Move already implemented functionality to the upper level so
it could be used in a more generic way.

Signed-off-by: Ivan Nikolaenko <ivan.nikolaenko@unikie.com>
This commit is contained in:
Ivan Nikolaenko 2022-09-27 15:10:45 +03:00 committed by Alyssa Ross
parent f78fb2153c
commit f251840237
2 changed files with 15 additions and 13 deletions

View file

@ -141,6 +141,14 @@ rec {
powerpc64le = "ppc64le";
}.${final.parsed.cpu.name} or final.parsed.cpu.name;
# Name used by UEFI for architectures.
efiArch =
if final.isx86_32 then "ia32"
else if final.isx86_64 then "x64"
else if final.isAarch32 then "arm"
else if final.isAarch64 then "aa64"
else final.parsed.cpu.name;
darwinArch = {
armv7a = "armv7";
aarch64 = "arm64";

View file

@ -53,6 +53,13 @@ let
image = "/boot/${config.system.boot.loader.kernelFile}";
initrd = "/boot/initrd";
};
targetArch =
if config.boot.loader.grub.forcei686 then
"ia32"
else
stdenv.hostPlatform.efiArch;
in
menuBuilderGrub2
finalCfg
@ -431,19 +438,6 @@ let
fsck.vfat -vn "$out"
''; # */
# Name used by UEFI for architectures.
targetArch =
if pkgs.stdenv.isi686 || config.boot.loader.grub.forcei686 then
"ia32"
else if pkgs.stdenv.isx86_64 then
"x64"
else if pkgs.stdenv.isAarch32 then
"arm"
else if pkgs.stdenv.isAarch64 then
"aa64"
else
throw "Unsupported architecture";
# Syslinux (and isolinux) only supports x86-based architectures.
canx86BiosBoot = pkgs.stdenv.hostPlatform.isx86;