- 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
59 lines
2.1 KiB
Nix
59 lines
2.1 KiB
Nix
{ config, lib, ... }:
|
|
|
|
let
|
|
themePath = ../palettes + "/${config.nomarchy.theme}";
|
|
themeAppsPath = themePath + "/apps";
|
|
nordAppsPath = ../palettes/nord/apps;
|
|
|
|
# Check if theme has apps/hyprland.conf
|
|
hasHyprlandConf = builtins.pathExists (themeAppsPath + "/hyprland.conf");
|
|
in
|
|
{
|
|
xdg.configFile."nomarchy/current/theme" = {
|
|
source = themePath;
|
|
recursive = true;
|
|
};
|
|
|
|
# Ensure theme-specific hyprland config exists, fallback to nord if not
|
|
# Now checking in apps/ subdirectory
|
|
xdg.configFile."nomarchy/current/theme/apps/hyprland.conf" = lib.mkIf (!hasHyprlandConf) {
|
|
source = nordAppsPath + "/hyprland.conf";
|
|
};
|
|
|
|
# Legacy compatibility: symlink apps/hyprland.conf to root for scripts expecting old path
|
|
xdg.configFile."nomarchy/current/theme/hyprland.conf" = {
|
|
source =
|
|
if hasHyprlandConf
|
|
then themeAppsPath + "/hyprland.conf"
|
|
else nordAppsPath + "/hyprland.conf";
|
|
};
|
|
|
|
xdg.configFile."nomarchy/current/theme.name".text = config.nomarchy.theme;
|
|
|
|
# Expose branding assets
|
|
xdg.configFile."nomarchy/branding/logo.png".source = ../../core/branding/logo.png;
|
|
xdg.configFile."nomarchy/branding/logo.txt".source = ../../core/branding/logo.txt;
|
|
xdg.configFile."nomarchy/branding/logo.svg".source = ../../core/branding/logo.svg;
|
|
xdg.configFile."nomarchy/branding/icon.png".source = ../../core/branding/icon.png;
|
|
xdg.configFile."nomarchy/branding/icon.txt".source = ../../core/branding/icon.txt;
|
|
|
|
# Expose all themes to the system via local share for script accessibility
|
|
# We filter out images to prevent Nix Store bloat
|
|
xdg.dataFile."nomarchy/themes".source = builtins.path {
|
|
name = "nomarchy-themes-no-images";
|
|
path = ../palettes;
|
|
filter = path: type:
|
|
let
|
|
baseName = baseNameOf path;
|
|
in
|
|
! (type == "regular" && (
|
|
lib.hasSuffix ".jpg" baseName ||
|
|
lib.hasSuffix ".png" baseName ||
|
|
lib.hasSuffix ".jpeg" baseName
|
|
));
|
|
};
|
|
|
|
# Nautilus python extensions
|
|
xdg.dataFile."nautilus-python/extensions/localsend.py".source = ../../core/home/config/nautilus-python/extensions/localsend.py;
|
|
}
|