{ lib, config, ... }: let # Path to your configuration assets wofiAssets = ../../../assets/system/conf/wofi; # Read the files in that directory wofiFiles = builtins.readDir wofiAssets; # Build an attribute set mapping filenames to their full paths wofiConfs = lib.genAttrs (builtins.attrNames wofiFiles) (name: { src = "${wofiAssets}/${name}"; }); # Toggle for enabling Wofi enableWofi = true; in { # Module option to enable/disable Wofi options.enableWofi = lib.mkEnableOption "Enable Wofi terminal launcher"; # Everything in config is wrapped safely with mkIf config = lib.mkIf enableWofi { # Use mySystem as a container for all your programs mySystem = { wofi = { enable = true; assetsDir = wofiAssets; files = wofiConfs; # Example: you could reference a top-level user option user = config.defaultUser or "henrov"; }; }; }; }