Setting up console font (nerdfonts)

hello, i’ve been trying to get JetBrainsMonoNerdFont on my console but it just won’t work. Here’s what in my configuration.nix:

#console configs
  fonts.packages = with pkgs; [nerdfonts];
  fonts.fontDir.enable = true;
  console = {
    enable = true;   
    packages = with pkgs; [nerdfonts];
    #font = "/run/current-system/sw/share/X11/fonts/JetBrainsMonoNerdFont-Regular.ttf"; 
  };

tried:

font = "/run/current-system/sw/share/X11/fonts/JetBrainsMonoNerdFont-Regular.ttf"; 
font = "JetBrainsMonoNerdFont-Regular.ttf"; 
font = "JetBrainsMonoNerdFont-Regular"; 
font = "JetBrainsMono Nerd Font"; 

nothing works

The console is the TTY, which does not support nerd fonts, as far as I know.

If you are trying to do it your terminal emulator, the console font is the wrong option to set.

1 Like

my apologies, i meant to configure the font of terminal emulator, which is kitty in my case

here’s my config for someone who’s lost like me, you need home manager:

# file: home.nix
    # Kitty terminalllll
    programs.kitty = {
      enable = true;
      font = {
        name = "JetBrainsMono Nerd Font";
        size = 10;
      };
      shellIntegration.enableFishIntegration = true;
      theme = "Catppuccin-Macchiato";
      #Also available: Catppuccin-Frappe Catppuccin-Latte Catppuccin-Macchiato Catppuccin-Mocha
      # See all available kitty themes at: https://github.com/kovidgoyal/kitty-themes/blob/46d9dfe230f315a6a0c62f4687f6b3da20fd05e4/themes.json
    };
#file configuration.nix
environment.systemPackages = with pkgs; [
  kitty
  kitty-themes
];

fonts.packages = with pkgs; [ nerdfonts ];
1 Like

You can also download specific nerdfonts instead of getting all of them:

font.packages = with pkgs; [ (nerdfonts.override { fonts = [ "JetBrainsMono" ]; }) ];
2 Likes

THis might be a silly question, but howdo you determine the name of the font to use in the override? I was looking on their site to see if it was something obvious. Does it just match the name of the zip in their download links? It seems to (minus the .zip).

choose the branch you’re using accordingly

Thanks for that! And these seem to map to the zip files. I had loaded a few to test and they seemed to work without issue. But this is a better list. Appreciated.