anchor.diff:          environment.etc.kbd.source = "${consoleEnv pkgs.kbd}/share";
   
           boot.initrd.preLVMCommands = mkIf (!config.boot.initrd.systemd.enable) (mkBefore ''
  -          if ${isUnicode} ; then
  -            kbd_mode -u -C /dev/console
  -            printf "\033%%G" >> /dev/console
  -          else
  -            kbd_mode -a -C /dev/console
  -            printf "\033%%@" >> /dev/console
  -          fi
  +          kbd_mode ${if isUnicode then "-u" else "-a"} -C /dev/console
  +          printf "\033%%${if isUnicode then "G" else "@"}" >> /dev/console
             loadkmap < ${optimizedKeymap}
   
             ${optionalString cfg.earlySetup ''
  
positive.code: 
    makeColor = i: concatMapStringsSep "," (x: "0x" + substring (2*i) 2 x);
  
    isUnicode = '' \
      LOCALE_ARCHIVE=${config.i18n.glibcLocales}/lib/locale/locale-archive \
      LANG=${config.i18n.defaultLocale} \
      LC_IDENTIFICATION=${config.i18n.defaultLocale} \
      locale -k identification-codeset | grep -i UTF-8 \
    '';
  
    optimizedKeymap = pkgs.runCommand "keymap" {
      nativeBuildInputs = with pkgs.buildPackages; [ kbd locale ];
      LOADKEYS_KEYMAP_PATH = "${consoleEnv pkgs.kbd}/share/keymaps/**";
      preferLocalBuild = true;
    } ''
      if ${isUnicode} ; then
        loadkeys -b -u "${cfg.keyMap}" > $out
      else
        loadkeys -b "${cfg.keyMap}" > $out
      fi
    '';
  
    # Sadly, systemd-vconsole-setup doesn't support binary keymaps.
  
negative.code:     })
  
      (mkIf setVconsole (mkMerge [
        { environment.systemPackages = [ pkgs.kbd ];
  
          # Let systemd-vconsole-setup.service do the work of setting up the
          # virtual consoles.
  