{ osConfig, config, pkgs, lib, ... }: let cfg = config.catppuccin; in { options.catppuccin.niri.enable = lib.mkOption { type = lib.types.bool; default = cfg.enable; }; config = lib.mkIf (config.wayland.windowManager.niri.enable && config.catppuccin.niri.enable) { wayland.windowManager.niri.settings = let hex = lib.pipe "${cfg.sources.palette}/palette.json" [ lib.importJSON (p: p.${cfg.flavor}.colors) (lib.mapAttrs (n: v: v.hex)) (p: p // { accent = p.${cfg.accent}; }) ]; colors = { active-color = hex.accent; inactive-color = hex.overlay2; urgent-color = hex.yellow; }; in { layout = { background-color = hex.crust; focus-ring = colors; border = colors; tab-indicator = colors; insert-hint.color = "${hex.accent}80"; }; cursor = { xcursor-theme = with config.catppuccin.cursors; "catppuccin-${flavor}-${accent}-cursors"; }; }; }; }