danth / stylix

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

"error: attribute 'lib' missing" when rebuilding system #20

Closed feathecutie closed 1 year ago

feathecutie commented 1 year ago

When trying to use stylix in my system configuration (by simply importing stylix.nixosModules.stylix and setting stylix.image and also having home-manager already imported), I always receive the following error when trying to rebuild my system:

error: attribute 'lib' missing

       at /nix/store/9jaxhhsd44pl35x4ai7silsyncs73vj7-source/modules/vim.nix:38:5:

           37|   options.stylix.targets.vim.enable =
           38|     config.lib.stylix.mkEnableTarget "Vim and/or Neovim" true;
             |     ^
           39|

The commit that introduced this seems to be a1c4e8179bfe7345945b6c18998b5b0480e58bbd, as this seems to be the commit that introduced the usage of config.lib(.stylix) in the codebase and every commit right before this works perfectly fine.

My best guess as to why this might occur is that the corresponding option (options.lib(.stylix)) is never declared in any module and as far as I know, only config definitions that have a corresponding option declaration are considered valid by the module system, but it might be something else entirely.

danth commented 1 year ago

I can't seem to reproduce this.

config.lib is a special option which allows anything to be created inside it, without being specifically declared. I wonder if another part of your configuration is overriding what Stylix has added there.

feathecutie commented 1 year ago

No idea what has changed in my config since my last attempt, but now I can't reproduce this either and everything works just fine.

Still quite curious what might have caused this but since it definitely does not seem to be an issue with stylix itself, I'll close this.

Thanks for this amazing project!