diff --git a/modules/installer/grub/grub-menu-builder.sh b/modules/installer/grub/grub-menu-builder.sh index cf2041002e74..ecb69ceb263f 100644 --- a/modules/installer/grub/grub-menu-builder.sh +++ b/modules/installer/grub/grub-menu-builder.sh @@ -216,6 +216,10 @@ extraEntries=`cat <> $tmp <> $tmp fi diff --git a/modules/installer/grub/grub.nix b/modules/installer/grub/grub.nix index 4217e0d481c4..40c2ca606751 100644 --- a/modules/installer/grub/grub.nix +++ b/modules/installer/grub/grub.nix @@ -12,7 +12,8 @@ let inherit grub; inherit (pkgs) bash; path = [pkgs.coreutils pkgs.gnused pkgs.gnugrep]; - inherit (config.boot.loader.grub) copyKernels extraEntries extraEntriesBeforeNixOS + inherit (config.boot.loader.grub) copyKernels + extraConfig extraEntries extraEntriesBeforeNixOS splashImage configurationLimit version default timeout; }; @@ -67,6 +68,15 @@ in ''; }; + extraConfig = mkOption { + default = ""; + example = "serial; terminal_output.serial"; + description = '' + Additional GRUB commands inserted in the configuration file + just before the menu entries. + ''; + }; + extraEntries = mkOption { default = ""; example = '' diff --git a/tests/installer.nix b/tests/installer.nix index a15b5587511b..1f9ada808b26 100644 --- a/tests/installer.nix +++ b/tests/installer.nix @@ -40,6 +40,7 @@ let boot.loader.grub.version = 2; boot.loader.grub.device = "/dev/vda"; + boot.loader.grub.extraConfig = "serial; terminal_output.serial"; boot.initrd.kernelModules = [ "ext3" ]; fileSystems = [ ${fileSystems} ];