feat(home): enhance user environment and dynamic theming

- Implement dynamic palette generation from colors.toml themes
- Update script wrapper to handle non-executable source files
- Integrate Stylix for unified application theming
- Add state-based logic for persistent dynamic configurations
This commit is contained in:
Bernardo Magri
2026-04-03 21:07:12 +01:00
parent 14d7a89a84
commit 90e1a21701
6 changed files with 29 additions and 14 deletions

View File

@@ -7,7 +7,7 @@ let
themeStateFile = "${config.home.homeDirectory}/.config/home-manager/theme-state.nix";
activeThemeName = if builtins.pathExists themeStateFile then
lib.removeSuffix "\n" (builtins.readFile themeStateFile)
else "dracula";
else "nord";
wallpaperStateFile = "${config.home.homeDirectory}/.config/home-manager/wallpaper-state.nix";
activeWallpaper = if builtins.pathExists wallpaperStateFile then
@@ -15,13 +15,14 @@ let
else "${../../themes/catppuccin/backgrounds/1-totoro.png}"; # Fallback
# Map nix-colors palette to a format Stylix expects (attrset of hex strings)
currentPalette = (palettes.${activeThemeName} or palettes.dracula).palette;
currentPalette = (palettes.${activeThemeName} or palettes.nord).palette;
in
{
imports = [ inputs.stylix.homeModules.stylix ];
stylix = {
enable = true;
enableReleaseChecks = false;
image = activeWallpaper;
base16Scheme = currentPalette;