anchor.diff:      })
   
       (mkIf setVconsole (mkMerge [
  -      { environment.systemPackages = with pkgs; [ kbd locale ];
  +      { environment.systemPackages = [ pkgs.kbd ];
   
           # Let systemd-vconsole-setup.service do the work of setting up the
           # virtual consoles.
  
positive.code:         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
            loadkmap < ${optimizedKeymap}
  
            ${optionalString cfg.earlySetup ''
  
negative.code: 
    makeColor = i: concatMapStringsSep "," (x: "0x" + substring (2*i) 2 x);
  
    isUnicode = hasSuffix "UTF-8" (toUpper config.i18n.defaultLocale);
  
    optimizedKeymap = pkgs.runCommand "keymap" {
      nativeBuildInputs = [ pkgs.buildPackages.kbd ];
      LOADKEYS_KEYMAP_PATH = "${consoleEnv pkgs.kbd}/share/keymaps/**";
      preferLocalBuild = true;
    } ''
      loadkeys -b ${optionalString isUnicode "-u"} "${cfg.keyMap}" > $out
    '';
  
    # Sadly, systemd-vconsole-setup doesn't support binary keymaps.
  