How can I install FiraCode font in NixOS?

Hi,

I would like to install FiraCode font. Unfortunately, the installing guide does not mention NixOS documentation .

I tried finding it as an official package, but could not.

This is my config file . What should I do in situations like this? How do you handle new fonts in your NixOS’ system?

Thanks!

Fonts - NixOS Wiki has some examples.

3 Likes

This might as well be an option for you:

2 Likes

You can simply add them to fonts.fonts. Fira Code is packaged in Nixpkgs as pkgs.fira-code.

So just add this:

{
  fonts.fonts = with pkgs; [ fira-code ];
}
2 Likes

https://search.nixos.org/options will tell you about fonts.fonts, and many other things :slight_smile: NixOS Search allows you to search packages too.

Generally when using a distro (and especially NixOS, because it’s so different from Ubuntu/Debian/Arch, which most projects are implicitly designed for), check if a distro-specific bit of documentation, package or any such thing already exists, before falling back to upstream suggestions.

2 Likes

Wow, so many good answers! I wanted to point out that your original search was searching the options for a package. If you want to search for a package, make sure to use https://search.nixos.org/packages. For example, https://search.nixos.org/packages?channel=21.11&from=0&size=50&sort=relevance&type=packages&query=fira would have found the package, but unfortunately wouldn’t have given you information about how to install it!

3 Likes