anchor.diff:      # Fonts can be loaded?
       # (This font is assumed to always be provided as a fallback by NixOS)
       if loadfont /EFI/boot/unicode.pf2; then
  +      set with_fonts=true
  +    fi
  +    if [ "\$textmode" != "true" -a "\$with_fonts" == "true" ]; then
         # Use graphical term, it can be either with background image or a theme.
         # input is "console", while output is "gfxterm".
         # This enables "serial" input and output only when possible.
  
positive.code:     export with_serial
      clear
      set timeout=10
      ${grubMenuCfg}
  
      # If the parameter iso_path is set, append the findiso parameter to the kernel
      # line. We need this to allow the nixos iso to be booted from grub directly.
  
negative.code: 
      cat <<EOF > $out/EFI/boot/grub.cfg
  
      set with_fonts=false
      set textmode=false
      # If you want to use serial for "terminal_*" commands, you need to set one up:
      #   Example manual configuration:
      #    → serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1
  