How to install Nerdfonts?

I assume there’s a good reason that installing nerdfonts isn’t as simple as just listing the nerdfonts packages we want in systemPackages, but it’s proving quite challenging for me.

I tried adding nerdfonts packages to fonts.packages but I got this error:

       error: nerdfonts has been separated into individual font packages under the namespace nerd-fonts.
       For example change:
         fonts.packages = [
           ...
           (pkgs.nerdfonts.override { fonts = [ "0xproto" "DroidSansMono" ]; })
         ]
       to
         fonts.packages = [
           ...
           pkgs.nerd-fonts._0xproto
           pkgs.nerd-fonts.droid-sans-mono
         ]
       or for all fonts
         fonts.packages = [ ... ] ++ builtins.filter lib.attrsets.isDerivation (builtins.attrVa

I then decided to follow what the messaged said and add:

fonts.packages = [ ... ] ++ builtins.filter lib.attrsets.isDerivation (builtins.attrValues pkgs.nerd-fonts)

to my system configuration, removing previous fonts.packages lines. But, of course, this didn’t work and I received the error:

building Nix...
error:
       … while evaluating the attribute 'config'
         at /nix/store/9iswvhwdhwri7ng3qrqjy5ppw710gpd4-nixos-25.05/nixos/lib/modules.nix:359:9:
          358|         options = checked options;
          359|         config = checked (removeAttrs config [ "_module" ]);
             |         ^
          360|         _module = checked (config._module);

       … while calling the 'seq' builtin
         at /nix/store/9iswvhwdhwri7ng3qrqjy5ppw710gpd4-nixos-25.05/nixos/lib/modules.nix:359:18:
          358|         options = checked options;
          359|         config = checked (removeAttrs config [ "_module" ]);
             |                  ^
          360|         _module = checked (config._module);

       (stack trace truncated; use '--show-trace' to show the full, detailed trace)

       error: syntax error, unexpected ELLIPSIS
       at /home/fusion809/NixOS-configs/configuration.nix:352:20:
          351|   # networking.firewall.enable = false;
          352| fonts.packages = [ ... ] ++ builtins.filter lib.attrsets.isDerivation (builtins.attrValues pkgs.nerd-fonts);
             |                    ^
          353| # This value determines the NixOS release from which the default
building the system configuration...

Can someone please help me here? I just want nerd fonts installed.

It should be fine without [ ... ] which was an example and not a valid expression.

Side note: you probably don’t want all nerdfonts installed (it’s several gigabytes, and redundant as they’ll all have the same icons repeated), just pick the font(s) you’ll use.

Thanks. Would:

fonts.packages = [ "JetBrains Mono" ] ++ builtins.filter lib.attrsets.isDerivation (builtins.attrValues pkgs.nerd-fonts);

make the JetBrainsMono Nerd Font available? I have it referenced in my Waybar style sheet.

Just write

fonts.packages = [ pkgs.nerd-fonts.jetbrains-mono ];

The full list of fonts to pick from is in nixpkgs/pkgs/data/fonts/nerd-fonts/manifests/fonts.json at de082c4dde81bc61bdb0332b806bbca68b1b07fd · NixOS/nixpkgs · GitHub

2 Likes