dustinlyons / nixos-config

General purpose Nix configuration for macOS / NixOS with starter templates + step-by-step guides ✨
BSD 3-Clause "New" or "Revised" License
1.8k stars 113 forks source link

How can I add stylix #67

Closed SolidRhino closed 6 months ago

SolidRhino commented 7 months ago

I want to add Stylix with the option to generate a wallpaper dynamically (See this option). But if I use this example:

stylix = {
  image = config.lib.stylix.pixel "base0A";
  base16Scheme = "${pkgs.base16-schemes}/share/themes/catppuccin-latte.yaml";
};

I get the following error:

error: undefined variable 'config'
    at /nix/store/lghn0x32saqcp5in1sw8jm04h2cvd4vv-source/flake.nix:90:25:
       89|  stylix = {
       90|    image = config.lib.stylix.pixel "base0A";
         |            ^
       91|    base16Scheme = "${pkgs.base16-schemes}/share/themes/catppuccin-latte.yaml";

How can I fix this?

dustinlyons commented 7 months ago

Make sure the first line of the file that looks like { pkgs, lib, ... }: etc includes config.

dustinlyons commented 6 months ago

Hi @SolidRhino, any luck with this?

dustinlyons commented 6 months ago

Closing, if you have future questions, please don't hesitate to reach out.