{ lib, config, pkgs, flakeRoot, user, ... }: let wofiConfigDir = "${config.home-manager.users.${user.username}.xdg.configHome}/wofi"; # Dynamically read all files in assets/hyprland/conf/wofi/ wofiConfs = lib.genAttrs (builtins.attrNames (builtins.readDir "${flakeRoot}/assets/system/conf/wofi")) (name: { text = builtins.readFile "${flakeRoot}/assets/system/conf/wofi/${name}"; }); in { environment.systemPackages = with pkgs; [ wofi ]; home-manager.users.${user.username} = { home.file = { # Map the files to their target paths in ~/.config/wofi/ "${wofiConfigDir}/config" = wofiConfs."wofi.conf"; # Use the actual filename "${wofiConfigDir}/style.css" = wofiConfs."theming.css"; # Use the actual filename }; home.sessionVariables = { WOFI_CONFIG = "${wofiConfigDir}/config"; WOFI_STYLE = "${wofiConfigDir}/style.css"; }; }; }