How can I install all fonts in nerdfonts by nixpkgs?

I would like to install all fonts in nerdfonts. However, recent updates make me write override like below.

nerdfonts.override {
  fonts = [
    "AnonymousPro"
    "Hack"
  ];
}

How can I install all of them as before?

This is my ideal ~/.config/nixpkgs/home.nix and I would like to install them by typing home-manager switch.

{ pkgs, ... }:
{
  fonts.fontconfig.enable = true;
  programs.home-manager.enable = true;
  home = {
    packages = with pkgs; [
      nerdfonts
    ];
  };
}

Or, just by typing nix-env -iA nixpkgs.nerdfonts.

Looking at the derivation, all known fonts should be automatically installed when you do not pass a fonts argument…

knownFonts = builtins.attrNames fontsShas;
selectedFonts = if (fonts == []) then
  knownFonts
else …;

But, when I tried to install nerdfonts following its wiki, I got this error.

❯ nix-env -iA nixpkgs.nerdfonts
installing 'nerdfonts-2.1.0'
error: value is a set while a list was expected, at /nix/store/vwrpmphv64gwqnxp719vy1d7x31zdwrv-nixpkgs-21.05pre291295.efee454783c/nixpkgs/pkgs/data/fonts/nerdfonts/default.nix:21:19
(use '--show-trace' to show detailed location information)

What’s wrong with my code?

You probably have an overlay that for some reason passes some invalid arguments.

1 Like

That was true!
It was my fault. I was making redundant configurations in config.nix. After removing them, I was able to install those fonts.