about summary refs log tree commit diff
path: root/nixos/modules/system
diff options
context:
space:
mode:
authorSamuel Dionne-Riel <samuel@dionne-riel.com>2019-04-08 10:06:59 -0400
committerGitHub <noreply@github.com>2019-04-08 10:06:59 -0400
commitef0ca61215e72259f791d93837bbb8a2ee110579 (patch)
treec02f152193bdc453d2d188fb9404b3b71e966af7 /nixos/modules/system
parent663030731e86aec87b8f7100a84e697898c7027a (diff)
parent84ff0956a8c4f0794b65dea5287b44cb9c312e76 (diff)
downloadnixlib-ef0ca61215e72259f791d93837bbb8a2ee110579.tar
nixlib-ef0ca61215e72259f791d93837bbb8a2ee110579.tar.gz
nixlib-ef0ca61215e72259f791d93837bbb8a2ee110579.tar.bz2
nixlib-ef0ca61215e72259f791d93837bbb8a2ee110579.tar.lz
nixlib-ef0ca61215e72259f791d93837bbb8a2ee110579.tar.xz
nixlib-ef0ca61215e72259f791d93837bbb8a2ee110579.tar.zst
nixlib-ef0ca61215e72259f791d93837bbb8a2ee110579.zip
Merge pull request #58027 from DanielFabian/gfxpayload
grub: Add gfxpayload
Diffstat (limited to 'nixos/modules/system')
-rw-r--r--nixos/modules/system/boot/loader/grub/grub.nix20
-rw-r--r--nixos/modules/system/boot/loader/grub/install-grub.pl6
2 files changed, 23 insertions, 3 deletions
diff --git a/nixos/modules/system/boot/loader/grub/grub.nix b/nixos/modules/system/boot/loader/grub/grub.nix
index d3cf8b29bb46..99aa7759c954 100644
--- a/nixos/modules/system/boot/loader/grub/grub.nix
+++ b/nixos/modules/system/boot/loader/grub/grub.nix
@@ -61,7 +61,7 @@ let
       inherit (cfg)
         version extraConfig extraPerEntryConfig extraEntries forceInstall useOSProber
         extraEntriesBeforeNixOS extraPrepareConfig extraInitrd configurationLimit copyKernels
-        default fsIdentifier efiSupport efiInstallAsRemovable gfxmodeEfi gfxmodeBios;
+        default fsIdentifier efiSupport efiInstallAsRemovable gfxmodeEfi gfxmodeBios gfxpayloadEfi gfxpayloadBios;
       path = with pkgs; makeBinPath (
         [ coreutils gnused gnugrep findutils diffutils btrfs-progs utillinux mdadm ]
         ++ optional (cfg.efiSupport && (cfg.version == 2)) efibootmgr
@@ -393,6 +393,24 @@ in
         '';
       };
 
+      gfxpayloadEfi = mkOption {
+        default = "keep";
+        example = "text";
+        type = types.str;
+        description = ''
+          The gfxpayload to pass to GRUB when loading a graphical boot interface under EFI. 
+        '';
+      };
+
+      gfxpayloadBios = mkOption {
+        default = "text";
+        example = "keep";
+        type = types.str;
+        description = ''
+          The gfxpayload to pass to GRUB when loading a graphical boot interface under BIOS. 
+        '';
+      };
+
       configurationLimit = mkOption {
         default = 100;
         example = 120;
diff --git a/nixos/modules/system/boot/loader/grub/install-grub.pl b/nixos/modules/system/boot/loader/grub/install-grub.pl
index bda6a3136407..a36b3c180eb4 100644
--- a/nixos/modules/system/boot/loader/grub/install-grub.pl
+++ b/nixos/modules/system/boot/loader/grub/install-grub.pl
@@ -67,6 +67,8 @@ my $efiInstallAsRemovable = get("efiInstallAsRemovable");
 my $efiSysMountPoint = get("efiSysMountPoint");
 my $gfxmodeEfi = get("gfxmodeEfi");
 my $gfxmodeBios = get("gfxmodeBios");
+my $gfxpayloadEfi = get("gfxpayloadEfi");
+my $gfxpayloadBios = get("gfxpayloadBios");
 my $bootloaderId = get("bootloaderId");
 my $forceInstall = get("forceInstall");
 my $font = get("font");
@@ -293,10 +295,10 @@ else {
               insmod gfxterm
               if [ \"\${grub_platform}\" = \"efi\" ]; then
                 set gfxmode=$gfxmodeEfi
-                set gfxpayload=keep
+                set gfxpayload=$gfxpayloadEfi
               else
                 set gfxmode=$gfxmodeBios
-                set gfxpayload=text
+                set gfxpayload=$gfxpayloadBios
               fi
               terminal_output gfxterm
             fi