{ config, pkgs, lib, user, flakeRoot, userConfig, ... }: let hyprlandConfigDir = "${config.home-manager.users.${user.username}.xdg.configHome}/hypr"; # Dynamically read all files in assets/hyprland/conf/ hyprlandConfs = lib.genAttrs (builtins.attrNames (builtins.readDir "${flakeRoot}/assets/hyprland/conf")) (name: { text = builtins.readFile "${flakeRoot}/assets/hyprland/conf/${name}"; }); in { # NixOS: Enable Hyprland (optional) programs.hyprland = { enable = true; }; # Home Manager: Hyprland-specific configurations home-manager.users.${user.username} = { home.stateVersion = userConfig.stateVersion; home.username = userConfig.username; home.homeDirectory = userConfig.homeDirectory; wayland.windowManager.hyprland = { enable = true; }; # Merge dynamic Hyprland configs with existing xdg.configFile xdg.configFile = { # Your existing manual configs (if any) # "hypr/hyprland.conf".text = "..."; } // hyprlandConfs; # Merge dynamic configs here }; }