danth / stylix

System-wide colorscheming and typography for NixOS
https://stylix.danth.me/
MIT License
1.16k stars 143 forks source link

The option "fonts.packages" does not exist #148

Closed prescientmoon closed 1 year ago

prescientmoon commented 1 year ago

Error:

  error: The option `fonts.packages' does not exist. Definition values:
       - In `/nix/store/w740vl5ciwlq5dqyy8xn0m0djn7875hh-source/stylix/nixos/fonts.nix':
           [
             <derivation nerdfonts-3.0.1>
             <derivation dejavu-fonts-2.37>
             <derivation fira-4.202>
             <derivation noto-fonts-emoji-2.038>
           ...

I cannot find the option here either.

prescientmoon commented 1 year ago

It looks like this is not an issue with nixpkgs-unstable

I think it's probably a good idea to hold off making this change until it gets shipped into stable nixpkgs?

TotalChaos05 commented 1 year ago

@danth dont know how i missed that, could you reverse my pr?

TotalChaos05 commented 1 year ago

wait i take that back, shouldnt you use the stable branch of stylix for stable nixpkgs?

prescientmoon commented 1 year ago

wait i take that back, shouldnt you use the stable branch of stylix for stable nixpkgs?

Oh, I did not know a stable branch existed (I haven't upgraded in a long time either, I was just looking to get the updated base16 nix which doesn't always use IFD).

I ended up creating a 10loc nixos module which adds the option and assigns it to the old one.

prescientmoon commented 1 year ago

For anyone struggling with this, the following should do the trick:

{ lib, config, ... }: {
  options.fonts.packages = lib.mkOption {
    type = lib.types.listOf lib.types.package;
  };

  config.fonts.fonts = config.fonts.packages;
}