Error: function 'anonymous lambda' called with unexpected argument 'fonts' - while updating from 24.11 to 25.05

I tried to update my os from 24.11 to 25.05, so i changed my flake,

flakes input
    # nixpkgs.url = "nixpkgs/nixos-24.11";
    nixpkgs.url = "nixpkgs/nixos-25.05";
    nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";

    # home-manager.url = "github:nix-community/home-manager/release-24.11";
    home-manager.url = "github:nix-community/home-manager/release-25.05";
    home-manager.inputs.nixpkgs.follows = "nixpkgs";

And when i did a rebuild i was getting few future version deprecation warnings for kate and fonts.
after change kates and fonts as suggested by the output, im getting this error,

fonts section
# configuration.nix
fonts.packages = with pkgs; [
    nerd-fonts
    font-awesome
    powerline-fonts
  ];
  fonts.fontconfig.enable = true;

# home.nix
(pkgs.nerd-fonts.override { fonts = [ "NerdFontsSymbolsOnly" ]; })

❯ nh os boot -H system

┃        error: function 'anonymous lambda' called with unexpected argument 'fonts'
┃        at /nix/store/malv0jrc9p3nm4rqjqg1y3v7h3bck176-source/pkgs/data/fonts/nerd-fonts/default.nix:1:…
┃             1| {
┃              | ^
┃             2|   lib,
┣━━━                                                            
┗━ ∑ ⚠ Exited with 1 errors reported by nix at 10:26:09 after 4s
Error: 
   0: Command exited with status Exited(1)

Location:
   src/commands.rs:217

Any help please ?!

I think the nerd-fonts management has changed recently. Have you checked the changelog ?

im sorry, do you mean release notes?
this is from the release notes if yes.

nerdfonts has been separated into individual font packages under the namespace nerd-fonts. The directories for font files have changed from $out/share/fonts/{opentype,truetype}/NerdFonts to $out/share/fonts/{opentype,truetype}/NerdFonts/<fontDirName>, where <fontDirName> can be found in the official website as the titles in preview images, with the “Nerd Font” suffix and any whitespaces trimmed. Configuration changes are required, see build output.

and i did changed exactly like how the output said so.

What that note is telling you is that, instead of calling override, you can just access nerd-fonts.symbols-only.

1 Like

Sorry for not understanding it completely. Instead i thought that, from now we can directly mention the specific font name as a suffix after nerd-font.<> alone, dint gave a thought about override.

I changed the home.nix like below from (pkgs.nerd-fonts.override { fonts = ["NerdFontsSymbolsOnly"];})

home.packages = with pkgs; [
   ...
   ...
   nerd-fonts.symbols-only
  ];

and im getting a diff error now,

┃        error: A definition for option `fonts.packages."[definition 1-entry 1]"' is not of type `absolute path'. Definition values:
┃        - In `/nix/store/83j5w6nwf3h6ks8wxshmiaaqv5k0rjri-source/configuration.nix':
┃            {
┃              _0xproto = <derivation nerd-fonts-0xproto-3.4.0+2.300>;
┃              _3270 = <derivation nerd-fonts-3270-3.4.0+3.0.1>;
┃              adwaita-mono = <derivation nerd-fonts-adwaita-mono-3.4.0+32.4>;
┃              agave = <derivation nerd-fonts-agave-3.4.0+37>;
┃            ...

earlier under configuration.nix i just had it like this,

  fonts.packages = with pkgs; [
    nerdfonts     # which, after the output suggested i changed it to `nerd-fonts`
    font-awesome
    powerline-fonts
  ];

is the error telling me that i cant just mention nerd-font and instead i should be specific in picking the fonts like nerd-fonts.agave/adwaita-mono etc ? In that case what did it meant earlier when just the fonts.packages.nerdfonts was mentioned ? (i had an assumption that it just included every fonts or some kind of base package that was necessary for the symbols-only.

I actually need only symbols and icons. can you please correct me if my understanding was wrong.

Thanks.

fonts.packages = with pkgs; [
    nerd-fonts.symbols-only
    font-awesome
    powerline-fonts
  ];

Yes, that’s it.

I don’t know what this refers to, but the upshot is that there doesn’t seem to be any single all-the-fonts packages anymore. Since you only need symbols-only, just use that in either home.nix or configuration.nix (you don’t need it in both places).

thanks a lot for the help and clarification @drupol , @rhendric , @phanirithvij.
And it works now