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.44k stars 91 forks source link

How can I add stylix #67

Closed SolidRhino closed 3 months ago

SolidRhino commented 4 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 4 months ago

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

dustinlyons commented 4 months ago

Hi @SolidRhino, any luck with this?

dustinlyons commented 3 months ago

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