diff --git a/modules/home/configs.nix b/modules/home/configs.nix index ea95665..d08bf89 100644 --- a/modules/home/configs.nix +++ b/modules/home/configs.nix @@ -1,12 +1,30 @@ { config, pkgs, ... }: -{ - xdg.configFile = { - "btop".source = ../../config/btop; - "chromium".source = ../../config/chromium; - "fastfetch".source = ../../config/fastfetch; - "kitty".source = ../../config/kitty; - "swayosd".source = ../../config/swayosd; - "xdg-terminals.list".source = ../../config/xdg-terminals.list; +let + configDir = ../../config; + + # Read the contents of the config directory + configEntries = builtins.readDir configDir; + + # Files to explicitly exclude (handled elsewhere or not intended for ~/.config/) + excludedFiles = [ + "nomarchy.ttf" + ]; + + # Filter the entries + validEntries = builtins.filter (name: !(builtins.elem name excludedFiles)) (builtins.attrNames configEntries); + + # Generate the xdg.configFile attribute set + # 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 = { + source = "${configDir}/${name}"; + recursive = configEntries.${name} == "directory"; + }; }; + +in +{ + xdg.configFile = builtins.listToAttrs (map makeMapping validEntries); }