refactor: major architectural restructure for theme-centric organization
Theme System: - Move all theme app configs to apps/ subdirectory (20 themes) - Add theme-loader.nix for dynamic theme config deployment - Simplify stylix.nix to focus on base theming only Override System: - Add overrides.nix for file-based config overrides - Add behavior-configs.nix for non-visual configuration - Split hypr/nomarchy.conf into behavior vs visual sections Module Improvements: - Add lib.mkDefault to all customizable settings - Add modules/lib/ with shared utilities and state schema - Update all home and system modules for downstream overridability Installer: - New minimal TTY installer (installer/install.sh) - Golden path: BTRFS + LUKS2 (disko-golden.nix) - New installer-iso.nix for TTY-only installation - Keep graphical installer as installerIsoGraphical option Cleanup: - Remove obsolete install.sh, disko-ext4.nix, install-nomarchy.sh - Update live-iso.nix references - Add .claude/ to .gitignore for local IDE settings Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -2,54 +2,68 @@
|
||||
|
||||
let
|
||||
configDir = ../../config;
|
||||
|
||||
# Read the contents of the upstream config directory
|
||||
configEntries = builtins.readDir configDir;
|
||||
|
||||
|
||||
# Explicit list of config items to manage
|
||||
# This replaces dynamic builtins.readDir for clarity and faster evaluation
|
||||
configItems = {
|
||||
# Directories
|
||||
btop = "directory";
|
||||
chromium = "directory";
|
||||
elephant = "directory";
|
||||
"environment.d" = "directory";
|
||||
fastfetch = "directory";
|
||||
fcitx5 = "directory";
|
||||
fontconfig = "directory";
|
||||
ghostty = "directory";
|
||||
git = "directory";
|
||||
hypr = "directory";
|
||||
"hyprland-preview-share-picker" = "directory";
|
||||
imv = "directory";
|
||||
kitty = "directory";
|
||||
lazygit = "directory";
|
||||
nomarchy = "directory";
|
||||
opencode = "directory";
|
||||
systemd = "directory";
|
||||
tmux = "directory";
|
||||
Typora = "directory";
|
||||
uwsm = "directory";
|
||||
wiremix = "directory";
|
||||
xournalpp = "directory";
|
||||
|
||||
# Files
|
||||
"brave-flags.conf" = "regular";
|
||||
"chromium-flags.conf" = "regular";
|
||||
"starship.toml" = "regular";
|
||||
"xdg-terminals.list" = "regular";
|
||||
};
|
||||
|
||||
# Files/directories handled elsewhere or not intended for ~/.config/
|
||||
# - nomarchy.ttf: font file, not a config
|
||||
# - waybar: handled in waybar.nix
|
||||
# - walker: handled in walker.nix
|
||||
# - alacritty: handled in alacritty.nix
|
||||
# - swayosd: handled in swayosd.nix
|
||||
|
||||
# Check for user overrides
|
||||
userConfigDir = config.nomarchy.configOverrides;
|
||||
userEntries = if userConfigDir != null && builtins.pathExists userConfigDir
|
||||
then builtins.readDir userConfigDir
|
||||
else {};
|
||||
|
||||
# Files to explicitly exclude (handled elsewhere or not intended for ~/.config/)
|
||||
excludedFiles = [
|
||||
"nomarchy.ttf"
|
||||
"waybar"
|
||||
"walker"
|
||||
"alacritty"
|
||||
"swayosd"
|
||||
];
|
||||
|
||||
# Get all unique names from both sources
|
||||
allNames = lib.unique (builtins.attrNames configEntries ++ builtins.attrNames userEntries);
|
||||
|
||||
# Filter the entries
|
||||
validEntries = builtins.filter (name: !(builtins.elem name excludedFiles)) allNames;
|
||||
hasUserOverrides = userConfigDir != null && builtins.pathExists userConfigDir;
|
||||
|
||||
# Generate the xdg.configFile attribute set
|
||||
# If a name exists in userEntries, it takes precedence.
|
||||
# For directories, we use `recursive = true;` to allow the user to create their own files alongside the read-only defaults.
|
||||
makeMapping = name: {
|
||||
inherit name;
|
||||
value = lib.mkDefault {
|
||||
source = if userEntries ? ${name}
|
||||
then "${userConfigDir}/${name}"
|
||||
else "${configDir}/${name}";
|
||||
recursive = (userEntries.${name} or configEntries.${name}) == "directory";
|
||||
makeMapping = name: type:
|
||||
let
|
||||
hasUserOverride = hasUserOverrides && builtins.pathExists "${userConfigDir}/${name}";
|
||||
source = if hasUserOverride then "${userConfigDir}/${name}" else "${configDir}/${name}";
|
||||
in {
|
||||
inherit name;
|
||||
value = lib.mkDefault {
|
||||
inherit source;
|
||||
recursive = type == "directory";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
configMappings = lib.mapAttrs' (name: type: makeMapping name type) configItems;
|
||||
|
||||
in
|
||||
{
|
||||
xdg.configFile = (builtins.listToAttrs (map makeMapping validEntries)) // {
|
||||
"nomarchy" = {
|
||||
source = ../../config/nomarchy;
|
||||
recursive = true;
|
||||
};
|
||||
"hypr" = {
|
||||
source = ../../config/hypr;
|
||||
recursive = true;
|
||||
};
|
||||
};
|
||||
xdg.configFile = configMappings;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user