{ lib, pkgs, config, flakeRoot, ... }: let username = config.defaultUser or "henrov"; ################################# # Optional extra config snippet ################################# extraConfigFile = "${flakeRoot}/generated/.config/kitty/extra.conf"; extraConfig = if builtins.pathExists extraConfigFile then builtins.readFile extraConfigFile else ""; in { ################################# # System-wide install ################################# environment.systemPackages = [ pkgs.kitty ]; ################################# # Stylix (system-level) ################################# stylix.targets.kitty.enable = true; ################################# # Home Manager ################################# home-manager.users = { "${username}" = { ################################# # Kitty config (single source of truth) ################################# programs.kitty = { enable = true; settings = { confirm_os_window_close = 0; dynamic_background_opacity = true; enable_audio_bell = false; mouse_hide_wait = "-1.0"; window_padding_width = 10; background_opacity = "0.5"; background_blur = 5; }; ################################# # Add your repo config safely ################################# extraConfig = '' # Your additional config ${extraConfig} # Theme include (Stylix usually handles this, but safe fallback) include themes/Catppuccin-Mocha.conf ''; }; }; }; }