diff --git a/settings/stylix.nix b/settings/stylix.nix index 7a0c34e..fb28ae9 100644 --- a/settings/stylix.nix +++ b/settings/stylix.nix @@ -34,7 +34,51 @@ }; }; - home-manager.users.fred = { config, lib, pkgs, ... }: { + home-manager.users.fred = { config, lib, pkgs, ... }: let + c = config.lib.stylix.colors; + # Map matugen's Material You placeholders to the closest base16 slot + # in stylix's palette. The mapping is approximate (Material You has + # more semantic colours than base16), but covers the placeholders + # used in our Zen userChrome and Vesktop quickCss templates. + stylixize = builtins.replaceStrings + [ + "{{colors.primary.default.hex}}" + "{{colors.primary_container.default.hex}}" + "{{colors.secondary_container.default.hex}}" + "{{colors.tertiary_container.default.hex}}" + "{{colors.surface.default.hex}}" + "{{colors.surface_container.default.hex}}" + "{{colors.surface_container_low.default.hex}}" + "{{colors.surface_container_high.default.hex}}" + "{{colors.on_surface.default.hex}}" + "{{colors.on_surface_variant.default.hex}}" + "{{colors.outline.default.hex}}" + "{{colors.outline_variant.default.hex}}" + ] + [ + "#${c.base0D}" # primary accent + "#${c.base02}" # primary container + "#${c.base0C}" # secondary container (cyan) + "#${c.base0E}" # tertiary container (purple) + "#${c.base00}" # surface (main bg) + "#${c.base01}" # surface container + "#${c.base00}" # surface container low + "#${c.base02}" # surface container high + "#${c.base05}" # on surface (fg) + "#${c.base04}" # on surface variant (muted fg) + "#${c.base03}" # outline + "#${c.base02}" # outline variant + ]; + in { + # Zen and Vesktop have no native stylix targets, so we keep the + # existing matugen CSS templates and substitute placeholders with + # stylix base16 colours at Nix-eval time. + home.file.".zen/fraudek5.Default Profile/chrome/userChrome.css".text = + stylixize (builtins.readFile "${inputs.self}/templates/zen-userChrome.css"); + + home.file.".config/vesktop/settings/quickCss.css".text = + stylixize (builtins.readFile "${inputs.self}/templates/vesktop-quickCss.css"); + # Folder icon recolor — was a matugen post-hook, now driven by # stylix's base16 palette. base0D is the conventional blue/accent # slot, which is what we want for Adwaita-style folder icons.