Im trying to unify my darwin and nixos module for stylix but get infinite recursion when importing stylix modules:
{
config,
lib,
pkgs,
inputs,
...
}:
let
cfg = config.modules.stylix;
inherit (pkgs.stdenv) isDarwin;
in
{
imports = [
(if isDarwin then inputs.stylix.darwinModules.stylix else inputs.stylix.nixosModules.stylix)
# inputs.stylix.nixosModules.stylix
];
options.modules.stylix = {
enable = lib.mkEnableOption "enable stylix module";
};
config = lib.mkIf cfg.enable {
stylix = {
## temp untill 25.05 release of stylix
# https://github.com/nix-community/stylix/issues/1277
enableReleaseChecks = false;
enable = true;
autoEnable = true;
polarity = "dark";
base16Scheme = "${pkgs.base16-schemes}/share/themes/catppuccin-mocha.yaml";
# image = ../../assets/wallpapers/1CA1273E-9951-440E-A4DB-3BFFB7EB4346.png;
# image = "${inputs.wallpapers}/series/steven universe/barn.png";
image = builtins.fetchurl {
url = "https://gitlab.com/Felipe-Pinto/wallpapers/-/blob/e173091770ecf5a911f6f01f9b7dafc23081f4bc/series/steven%20universe/barn.png";
sha256 = "sha256:0y9wx0qwfj0rcdwv6my0lvyxhxpj6rm9f4gw8mk27ap99hmry85c";
};
opacity = {
applications = 0.9;
desktop = 0.9;
popups = 0.9;
terminal = 0.9;
};
cursor = {
package = pkgs.bibata-cursors;
name = "Bibata-Modern-Classic";
size = 24;
};
fonts = {
sizes = {
terminal = 20;
desktop = 14;
applications = 14;
popups = 16;
};
# monospace = {
# package = pkgs.nerdfonts.override {fonts=["FiraCode"];};
# name = "FiraCode";
# };
sansSerif = {
package = pkgs.source-sans;
name = "SourceSans3";
};
serif = {
package = pkgs.source-serif;
name = "SourceSerif4";
};
monospace = {
package = pkgs.nerd-fonts.fira-code;
name = "FiraCode";
};
};
targets = lib.genAttrs [ "nixvim" ] (_: {
enable = false;
});
};
};
}