refactor: implement component-based architecture for enhanced maintainability
- Reorganize directory structure into core/, features/, and themes/ - Colocate application Nix logic, configs, scripts, and theme overrides - Implement 'Inversion of Control' for theming: apps now pull theme-specific layouts - Update flake.nix and shared library paths to match the new structure - Document the new Feature-Centric architecture in README.md
This commit is contained in:
44
themes/palettes/default.nix
Normal file
44
themes/palettes/default.nix
Normal file
@@ -0,0 +1,44 @@
|
||||
let
|
||||
themesDir = ./.;
|
||||
|
||||
# Get all directories in the themes folder that have a colors.toml file
|
||||
allEntries = builtins.readDir themesDir;
|
||||
directories = builtins.filter (name:
|
||||
allEntries.${name} == "directory" && builtins.pathExists (themesDir + "/${name}/colors.toml")
|
||||
) (builtins.attrNames allEntries);
|
||||
|
||||
readTheme = name:
|
||||
let
|
||||
toml = builtins.fromTOML (builtins.readFile (themesDir + "/${name}/colors.toml"));
|
||||
|
||||
# Helper to strip '#' from color codes
|
||||
stripHash = s: builtins.replaceStrings ["#"] [""] s;
|
||||
|
||||
in {
|
||||
inherit name;
|
||||
author = "nomarchy";
|
||||
palette = {
|
||||
base00 = stripHash toml.background;
|
||||
base01 = stripHash toml.color0;
|
||||
base02 = stripHash toml.color8;
|
||||
base03 = stripHash toml.color8;
|
||||
base04 = stripHash toml.color7;
|
||||
base05 = stripHash toml.foreground;
|
||||
base06 = stripHash toml.color15;
|
||||
base07 = stripHash toml.color15;
|
||||
base08 = stripHash toml.color1;
|
||||
base09 = stripHash toml.color3;
|
||||
base0A = stripHash toml.color3;
|
||||
base0B = stripHash toml.color2;
|
||||
base0C = stripHash toml.color6;
|
||||
base0D = stripHash toml.color4;
|
||||
base0E = stripHash toml.color5;
|
||||
base0F = stripHash toml.color1;
|
||||
};
|
||||
};
|
||||
|
||||
in
|
||||
builtins.listToAttrs (map (name: {
|
||||
inherit name;
|
||||
value = readTheme name;
|
||||
}) directories)
|
||||
Reference in New Issue
Block a user