{ config, pkgs, lib, user, flakeRoot, ... }: let # Get all files from your assets directory hyprlandFiles = builtins.attrNames (builtins.readDir "${flakeRoot}/assets/hyprland/conf/hypr"); # Create a mapping of filename to source path for each file hyprlandConfs = lib.genAttrs hyprlandFiles (name: { source = "${flakeRoot}/assets/hyprland/conf/hypr/${name}"; }); in { # Enable Hyprland programs.hyprland = { enable = true; }; # Home Manager configuration home-manager.users.${user.username} = { home.stateVersion = "25.11"; home.username = user.username; home.homeDirectory = config.home-manager.users.${user.username}.homeDirectory or "/home/${user.username}"; wayland.windowManager.hyprland = { enable = true; }; # Create the config directory and all files xdg.configFile = { "hypr/.keep" = { text = ""; }; } // lib.mapAttrs (name: value: "hypr/${name}") hyprlandConfs; }; }