{ homeManager, inputs, moduleNameSpace, ... }: { config, lib, pkgs, ... }: let cfg = config.${moduleNameSpace}.matugen; in { imports = lib.optionals homeManager [ ./templates ]; options.${moduleNameSpace}.matugen = { enable = lib.mkEnableOption "Enable Dynamic colors"; }; config = lib.mkIf cfg.enable ( lib.optionalAttrs homeManager { xdg.configFile = { "matugen/config.toml" = { text = # toml '' [config] ${lib.optionalString config.programs.zathura.enable '' [templates.zathura] input_path = '~/.config/matugen/templates/zathura.toml' output_path = '~/.config/zathura/matugen' ''} ${lib.optionalString config.beeMods.terminal.foot '' [templates.foot] input_path = '~/.config/matugen/templates/foot-colors.ini' output_path = '~/.config/foot/themes/matugen' ''} ${lib.optionalString config.beeMods.terminal.alacritty '' [templates.alacritty] input_path = '~/.config/matugen/templates/alacritty-colors.toml' output_path = '~/.config/alacritty/matugen.toml' ''} ${lib.optionalString config.beeMods.terminal.ghostty '' [templates.ghostty] input_path = '~/.config/matugen/templates/ghostty-colors.conf' output_path = '~/.config/ghostty/themes/matugen' post_hook = 'pkill -SIGUSR2 ghostty' ''} ${lib.optionalString config.beeMods.windowManagers.mango.enable '' [templates.mango] input_path = '~/.config/matugen/templates/mango.conf' output_path = '~/.config/mango/colors.conf' post_hook = 'mmsg dispatch reload_config' ''} ${lib.optionalString config.programs.btop.enable '' [templates.btop] input_path = '~/.config/matugen/templates/btop.theme' output_path = '~/.config/btop/themes/matugen.theme' ''} ${lib.optionalString config.programs.yazi.enable '' [templates.yazi] input_path = '~/.config/matugen/templates/yazi.toml' output_path = '~/.config/yazi/theme.toml' ''} ${lib.optionalString config.programs.vesktop.enable '' [templates.vesktop-midnight] input_path = "~/.config/matugen/templates/discord-midnight.css" output_path = "~/.config/vesktop/themes/midnight.css" [templates.vesktop-system24] input_path = "~/.config/matugen/templates/discord-system24.css" output_path = "~/.config/vesktop/themes/system24.css" ''} ${lib.optionalString config.services.dunst.enable '' [templates.dunst] input_path = '~/.config/matugen/templates/dunstrc' output_path = '~/.config/dunst/dunstrc.d/colors.conf' post_hook = "dunstctl reload" ''} ${lib.optionalString config.programs.rofi.enable '' [templates.rofi] input_path = '~/.config/matugen/templates/rofi-colors.rasi' output_path = '~/.config/rofi/shared/colors.rasi' ''} [templates.gtk3] input_path = '~/.config/matugen/templates/gtk.css' output_path = '~/.config/gtk-3.0/matugen.css' [templates.gtk4] input_path = '~/.config/matugen/templates/gtk.css' output_path = '~/.config/gtk-4.0/matugen.css' [templates.neovim] input_path = '~/.config/matugen/templates/neovim.json' output_path = '~/.config/beestuff/nvim-colors.json' [templates.waybarStyle] input_path = '~/.config/matugen/templates/waybar.css' output_path = '~/.config/waybar/style.css' [templates.waybarConfig] input_path = '~/.config/matugen/templates/waybar.jsonc' output_path = '~/.config/waybar/config.jsonc' post_hook = 'pkill -SIGUSR2 waybar' [templates.pywalfox] input_path = '~/.config/matugen/templates/pywalfox-colors.json' output_path = '~/.cache/wal/colors.json' post_hook = 'sh -c "command -v pywalfox && test -f ~/.cache/wal/colors.json && pywalfox {{ mode }} && pywalfox update"' ${lib.optionalString (config.beeMods.terminal.default == "foot" || config.beeMods.terminal.default == "ghostty") '' [templates.sequences] input_path = '~/.config/matugen/templates/sequences' output_path = '~/.config/beestuff/sequences' post_hook = "sh '${config.home.homeDirectory}/.config/beestuff/sequences'" '' } ''; }; }; } ); }