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>
main
Ivan Nikolaenko 2 years ago committed by Alyssa Ross
parent f78fb2153c
commit f251840237
  1. 8
      lib/systems/default.nix
  2. 20
      nixos/modules/installer/cd-dvd/iso-image.nix

@ -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";

@ -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;

Loading…
Cancel
Save