1

NixOS version: 20.09.3765.d6f63659a70 (Nightingale)

I am trying to install Input Fonts on NixOS (which I'm pretty new to).

I seem to be unable to install input-fonts on NixOS even though I have the following lines in my /etc/nixos/configuration.nix

fonts.fonts = with pkgs; [
  input-fonts
];

nixpkgs.config.allowUnfree = true;
nixpkgs.config.input-fonts.acceptLicense = true;

When trying to nixos-rebuild switch, I get the following error:

***
Unfortunately, we cannot download file Input-Font.zip automatically.
Please go to https://input.fontbureau.com/download/ to download it yourself, and add it to the Nix store
using either
  nix-store --add-fixed sha256 Input-Font.zip
or
  nix-prefetch-url --type sha256 file:///path/to/Input-Font.zip

***

Looks like the issue is that there is no static download URL accessible from the Fontbureau page.

So I have downloaded the zip manually and run nix-store --add-fixed sha256 Input-Font.zip, but frankly I don't really know what to do with the output and the docs for --add-fixed don't really shed any light on it for me.

I get an output like this: /nix/store/7vqs2n6hrnwgd9hf6rxyhg5hx5qnrd2s-Input-Font.zip

Is anyone more familiar with installing packages in this way able to shed light on what to do with this?


Alternatively I could install the fonts from the files I've downloaded manually, but I am also unclear on how to do that, NixOS docs state:

Adding personal fonts to ~/.fonts doesn't work

The ~/.fonts directory is being deprecated upstream[1]. It already doesn't work in NixOS.

The new preferred location is in $XDG_DATA_HOME/fonts, which for most users will resolve to ~/.local/share/fonts

I have tried adding the font files in ~/.local/share/fonts too, but they still don't get recognized when I try to use them in any config.


Any help on either method for getting these fonts working would be appreciated!

2 Answers 2

2

After following those instructions, you're supposed to retry the installation. If the hash matched exactly, you will get past that error you got.

EDIT: it seems that input-fonts was broken and that's why it wouldn't work; please follow https://github.com/NixOS/nixpkgs/pull/118665

1

OK turns out I just had a few more linux commands to learn to install fonts manually.

In the end this is what I did:

Moved all the TTF files for Input Mono into ~/.local/share/fonts, and ran the following commands (seperately):

fc-cache -f -v fc-list | grep "Input"

fc-cache seemed to flush the cache for fonts, fc-list with the grep printed out the names and styles of the installed Input fonts which I could then use in config.

Alacritty config was able to switch the fonts out on the fly, the nix config font changes required a reboot.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.