{ lib, ... }: let wofiAssets = ../../../assets/system/conf/wofi; wofiFiles = builtins.readDir wofiAssets; # Generate attribute set of files wofiConfs = lib.genAttrs (builtins.attrNames wofiFiles) (name: { src = "${wofiAssets}/${name}"; }); # Module options enableWofi = true; # or set to false to disable in { options = { enableWofi = lib.mkEnableOption "Enable Wofi terminal launcher"; }; # Conditional attributes returned directly wofi = if enableWofi then { xdg = { wofi = { source = wofiAssets; files = wofiConfs; }; }; } else {}; }