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:
32
features/desktop/waybar/default.nix
Normal file
32
features/desktop/waybar/default.nix
Normal file
@@ -0,0 +1,32 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
|
||||
let
|
||||
activeTheme = config.nomarchy.theme;
|
||||
|
||||
# Path to local theme files
|
||||
themeDir = ./themes + "/${activeTheme}";
|
||||
hasThemeConfig = builtins.pathExists (themeDir + "/config.jsonc");
|
||||
hasThemeStyle = builtins.pathExists (themeDir + "/style.css");
|
||||
|
||||
# Default fallback files
|
||||
defaultConfig = ./config/config.jsonc;
|
||||
defaultStyle = ./config/style.css;
|
||||
|
||||
# Selected files
|
||||
configFile = if hasThemeConfig then (themeDir + "/config.jsonc") else defaultConfig;
|
||||
styleFile = if hasThemeStyle then (themeDir + "/style.css") else defaultStyle;
|
||||
|
||||
in
|
||||
{
|
||||
programs.waybar = {
|
||||
enable = lib.mkDefault true;
|
||||
systemd.enable = lib.mkDefault true;
|
||||
|
||||
settings = lib.mkDefault [ (builtins.fromJSON (builtins.readFile configFile)) ];
|
||||
style = lib.mkDefault (builtins.readFile styleFile);
|
||||
};
|
||||
|
||||
home.packages = lib.mkDefault (with pkgs; [
|
||||
font-awesome
|
||||
]);
|
||||
}
|
||||
Reference in New Issue
Block a user