summary refs log tree commit diff
path: root/nixos/modules/system/boot/loader
diff options
context:
space:
mode:
authorPol Dellaiera <pol.dellaiera@protonmail.com>2023-07-28 17:26:24 +0200
committerGitHub <noreply@github.com>2023-07-28 17:26:24 +0200
commitfd304ecc8ac7cc8a0348c48908331e6da1426104 (patch)
treeb556c27bef1fbb730cb77f8cc41f01b494f9761c /nixos/modules/system/boot/loader
parent56fc24812e203b86aae87248569de8a18027d039 (diff)
parent53135cc8c7e8fa6d562bea8fc68dc5b553a7e76a (diff)
downloadnixpkgs-fd304ecc8ac7cc8a0348c48908331e6da1426104.tar
nixpkgs-fd304ecc8ac7cc8a0348c48908331e6da1426104.tar.gz
nixpkgs-fd304ecc8ac7cc8a0348c48908331e6da1426104.tar.bz2
nixpkgs-fd304ecc8ac7cc8a0348c48908331e6da1426104.tar.lz
nixpkgs-fd304ecc8ac7cc8a0348c48908331e6da1426104.tar.xz
nixpkgs-fd304ecc8ac7cc8a0348c48908331e6da1426104.tar.zst
nixpkgs-fd304ecc8ac7cc8a0348c48908331e6da1426104.zip
Merge pull request #236027 from iliana/grub-dont-die
nixos/grub: don't die on EFI-only systems if devices != ["nodev"]
Diffstat (limited to 'nixos/modules/system/boot/loader')
-rw-r--r--nixos/modules/system/boot/loader/grub/grub.nix5
1 files changed, 4 insertions, 1 deletions
diff --git a/nixos/modules/system/boot/loader/grub/grub.nix b/nixos/modules/system/boot/loader/grub/grub.nix
index 66b54155fbf..8f2f578e307 100644
--- a/nixos/modules/system/boot/loader/grub/grub.nix
+++ b/nixos/modules/system/boot/loader/grub/grub.nix
@@ -40,7 +40,10 @@ let
       backgroundColor = f cfg.backgroundColor;
       entryOptions = f cfg.entryOptions;
       subEntryOptions = f cfg.subEntryOptions;
-      grub = f grub;
+      # PC platforms (like x86_64-linux) have a non-EFI target (`grubTarget`), but other platforms
+      # (like aarch64-linux) have an undefined `grubTarget`. Avoid providing the path to a non-EFI
+      # GRUB on those platforms.
+      grub = f (if (grub.grubTarget or "") != "" then grub else "");
       grubTarget = f (grub.grubTarget or "");
       shell = "${pkgs.runtimeShell}";
       fullName = lib.getName realGrub;