Configuring Iosevka for Nix

Viewed 1182

I'm trying to add the Iosevka font to my nix config. For that I created a file fonts.nix. it cotains (amongst other things) a font array with this content:

fonts = with pkgs; [
  (iosevka.override {
    set = "custom";
    privateBuildPlan = {
    family = "Iosevka";
    design = [
      "common styles"
      "sans"
      "ligset-haskell"
    ] ++ cv;
    };
  })
  [...]
];

when i build the config though, nixos tells me the following:

error: anonymous function at [...]/nixos/pkgs/data/fonts/iosevka/default.nix:1:1 called with 
unexpected argument 'family', at [...]/nixos/lib/customisation.nix:69:16

as I have been unable to find documentation for the nix config, I used an exaple I found along with the iosevka documentation;

i tried removing the privateBuildPlan (then the same thing happens with design), i also tried moving the family out of the privateBuildPlan and keeping the rest as it is (same result as the first error).

however, I can't get it working; do you have any tipps or maybe a link to the documentation of the nix iosevka package? the package on nixos.org just links to the normal iosevka github where I couldn't find anything...

1 Answers

Here is what I use:

  fonts = {
    fontconfig = {
      # ultimate.enable = true; # This enables fontconfig-ultimate settings for better font rendering
      defaultFonts = {
        monospace = ["Iosevka"];
      };
    };
    enableFontDir = true;
    enableGhostscriptFonts = true;
    fonts = with pkgs; [
      terminus_font
      corefonts
      noto-fonts
      iosevka
    ];
  };

Which seems to be documented here: https://nixos.wiki/wiki/Fonts

Related