@@ -64,11 +64,21 @@ let
6464 )) + ":" + (makeSearchPathOutput "bin" "sbin" [
6565 pkgs.mdadm pkgs.utillinux
6666 ]);
67+ font = if lib.last (lib.splitString "." cfg.font) == "pf2"
68+ then cfg.font
69+ else "${convertedFont}";
6770 });
6871
6972 bootDeviceCounters = fold (device: attr: attr // { "${device}" = (attr."${device}" or 0) + 1; }) {}
7073 (concatMap (args: args.devices) cfg.mirroredBoots);
7174
75+ convertedFont = (pkgs.runCommand "grub-font-converted.pf2" {}
76+ (builtins.concatStringsSep " "
77+ ([ "${realGrub}/bin/grub-mkfont"
78+ cfg.font
79+ "--output" "$out"
80+ ] ++ (optional (cfg.fontSize!=null) "--size ${toString cfg.fontSize}")))
81+ );
7282in
7383
7484{
@@ -276,7 +286,7 @@ in
276286 extraInitrd = mkOption {
277287 type = types.nullOr types.path;
278288 default = null;
279− example = "/boot/extra_initrafms.gz";
289+ example = "/boot/extra_initramfs.gz";
280290 description = ''
281291 The path to a second initramfs to be supplied to the kernel.
282292 This ramfs will not be copied to the store, so that it can
@@ -305,6 +315,24 @@ in
305315 '';
306316 };
307317
318+ font = mkOption {
319+ type = types.nullOr types.path;
320+ default = "${realGrub}/share/grub/unicode.pf2";
321+ description = ''
322+ Path to a TrueType, OpenType, or pf2 font to be used by Grub.
323+ '';
324+ };
325+
326+ fontSize = mkOption {
327+ type = types.nullOr types.int;
328+ example = literalExample 16;
329+ default = null;
330+ description = ''
331+ Font size for the grub menu. Ignored unless <literal>font</literal>
332+ is set to a ttf or otf font.
333+ '';
334+ };
335+
308336 gfxmodeEfi = mkOption {
309337 default = "auto";
310338 example = "1024x768";