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UYNIO7ZFUCPQCUALYN4QC W7FXKQNLFW7WK6RBMDAKZZBP3TE4LG2VXJRZU644RDUWSP4UTOKQC BJ5I57ZLQES5S3HH7WW3Z4CZSBOU4GQVR4JWFXQ7T2TKVIFGG6QAC AH6HSGEDTDCT77KUZXFSBB3U22PORVZ2RFGEN2DHYJNUHG6UWDPAC { lib, ... }:letinherit (lib) mkOption types;# global theme configuration - use `tt dark` or `tt light` to switchis_dark = false;themes = {nvim.dark = "gruvbox-material";nvim.light = "gruvbox-material";alacritty.dark = "gruber_darker";alacritty.light = "gruvbox_material_medium_light";zellij.dark = "gruvbox-dark";zellij.light = "gruvbox-light";starship.dark = "dark_theme";starship.light = "light_theme";vivid.dark = "gruvbox-dark";vivid.light = "gruvbox-light";nushell.dark = "dark-theme";nushell.light = "light-theme";};# helpersget_theme = program: if is_dark then themes.${program}.dark else themes.${program}.light;variant = if is_dark then "dark" else "light";in{# define theme as a top-level option that all modules can access via config.themeoptions.theme = mkOption {type = types.attrs;default = {};description = "Global theme configuration";};# set the theme valuesconfig.theme = {# core theme stateis_dark = is_dark;variant = variant;# program-specific theme namesnvim = get_theme "nvim";alacritty = get_theme "alacritty";zellij = get_theme "zellij";starship = get_theme "starship";vivid = get_theme "vivid";nushell = get_theme "nushell";# expose raw theme definitions for flexibilitythemes = themes;};# export theme info as env varconfig.home.sessionVariables = {THEME_MODE = variant;};}
let nvim_source_file = $"($env.HOME)/nixos-config/home/modules/editor/nvim/set_colorscheme.lua"let zellij_config_file = $"($env.HOME)/nixos-config/home/modules/programs/zellij.nix"let starship_config_file = $"($env.HOME)/nixos-config/home/modules/shell/starship.nix"
let content = open $nvim_source_filelet flag_value = if $new_theme == "light" { "true" } else { "false" }let updated = $content | str replace --regex 'local use_light_theme = \w+' $'local use_light_theme = ($flag_value)'$updated | save $nvim_source_file --forceprint $"updated nvim use_light_theme to ($flag_value)"} catch { |e|print $"failed to update nvim theme: ($e.msg)"return}# update zellij themetry {let content = open $zellij_config_filelet updated = $content | str replace --regex 'theme = \w+_theme;' $'theme = ($new_theme)_theme;'$updated | save $zellij_config_file --forceprint $"updated zellij source to ($new_theme)_theme"
let content = open $theme_filelet updated = if $new_theme == "dark" {$content | str replace "is_dark = false;" "is_dark = true;"} else {$content | str replace "is_dark = true;" "is_dark = false;"}$updated | save $theme_file --forceprint $"updated theme to ($new_theme)"
# update starship themetry {let content = open $starship_config_filelet updated = $content | str replace --regex 'palette = "\w+_theme";' $'palette = "($new_theme)_theme";'$updated | save $starship_config_file --forceprint $"updated starship source to ($new_theme)_theme"} catch { |e|print $"failed to update starship theme: ($e.msg)"return}
$env.CARAPACE_BRIDGES = "zsh,fish,bash,inshellisense,clap"$env.LS_COLORS = (vivid generate gruvbox-dark-hard)
use std/config ${config.theme.nushell}$env.config.color_config = (${config.theme.nushell})$env.CARAPACE_BRIDGES = "zsh,fish,bash,inshellisense,clap"$env.LS_COLORS = (vivid generate ${config.theme.vivid})
local light_theme = "gruvbox-material"local dark_theme = "gruvbox-material"local use_light_theme = falselocal current_theme = dark_theme and light_theme or dark_themelocal bg = use_light_theme and "light" or "dark"
-- theme configuration from nix globalslocal current_theme = vim.g.theme_namelocal bg = vim.g.theme_variant