{ 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/hyprland/conf/wofi")) (name: { text = builtins.readFile "${flakeRoot}/assets/hyprland/conf/wofi/${name}"; }); in { environment.systemPackages = with pkgs; [ wofi ]; home-manager.users.${user.username} = { home.file = { inherit wofiConfs; # Map the files to their target paths in ~/.config/wofi/ "${wofiConfigDir}/config" = wofiConfs.config; "${wofiConfigDir}/style.css" = wofiConfs.theming.css; }; home.sessionVariables = { WOFI_CONFIG = "${wofiConfigDir}/config"; WOFI_STYLE = "${wofiConfigDir}/style.css"; }; }; }