How to use boot.loader.grub.splashImage?

I am trying to use a grub splashimage.

The example in the options documentation provides ‘./my-background.png’ as example.
But what is the current working directory in this context? I tried using an absolute path: “/etc/wallpapers/my-background.png”. The file exists and is readable; I am using it in services.xserver.displayManager.lightdm.background, that’s why I am very sure that it’s a valid file. But grub stays in text mode.

Can someone please provide a MWE for a configuration.nix that includes a working grub splashimage? I have browsed dozens of examples from here, Configuration Collection - NixOS Wiki, but none seems to include a splash image?

Followup question: Where is the generated grub configuration file stored? I cannot find it in the filesystem?

NB: The gnome-iso-installer from 22.11 does show a grub splash image on the machine.

I’d like to answer my own question for reference. By investigation of various examples on the net, the following MWE could be distilled: (This is a configuration for an EFI setup.)

boot.loader = {
  efi = {
    canTouchEfiVariables = true;
    efiSysMountPoint = "/boot/efi";
  grub = {
     enable = true;
     efiSupport = true;
     device = "nodev";
     splashImage           = ./image.png;

To answer the question about the path: The relative path is the path to /etc/nixos.

1 Like