How to install nerd-fonts patched inconsolata-lgc?

New to NixOS. I want to install nerd-fonts patched inconsolata-lgc, but not all the patched fonts.

According to https://github.com/NixOS/nixpkgs/blob/master/pkgs/data/fonts/nerdfonts/default.nix, seems like I need to pass in a “withFont” parameter, with “InconsolataLGC”. But I don’t know how to do it.

I tried:

fonts.fonts= with pkgs; [ nerdfonts.override { withFont = “InconsolataLGC” } ];

or

environment.systemPackages = with pkgs; [ nerdfonts.override { withFont = “InconsolataLGC” } ];

Neither worked. I think a more general question for me is, how do I pass options to individual packages?

BTW, do I need to install inconsolate-lgc font in fonts.fonts to install the nerd-patched version?

Thanks~

fonts.fonts= with pkgs; [ nerdfonts.override { withFont =
“InconsolataLGC” } ];

You need additional parenthesis, otherwise you’re building a list with
two elements: nerdfonts.override and { withFont = "InconsolataLGC"; }. (and add a ; after "InconsolataLGC")

However, you should be aware that installing only the inconsolata-lgc
font will still consume space on your hard drive, as you’ll have to
build it yourself, and that’ll trigger the full .tar.gz download from
nerdfonts. It should go away after a garbage-collection, though.

Also, font name “InconsolataLGC” appears to not exist.

I guess you want with pkgs; [ (nerdfonts.override { withFont = "Inconsolata"; }) ] or with pkgs; [ (nerdfonts.override { withFont = "InconsolataGo"; }) ] (names selected from the error message given by
trying with InconsolataLGC)

Thanks~ I will give it a try~