{ username ? throw "username argument is required", }: { config, inputs, lib, pkgs, ... }: let userConfig = config.users.users.${username}; hmConfig = config.home-manager.users.${username}; themeBin = lib.meta.getExe hmConfig.theme.pkg; in { home-manager.users.${username} = { imports = [ ./options.nix ]; theme.enable = true; wayland.windowManager.hyprland.settings.bind = [ "Ctrl_Alt, r, exec, ${themeBin}" "Ctrl_Alt, t, exec, ${themeBin} toggle" ]; home = { activation.themeInit = inputs.home-manager.lib.hm.dag.entryAfter [ "writeBoundary" ] "run ${themeBin}"; persistence."/persist${userConfig.home}".directories = [ "${hmConfig.xdg.relativeConfigHome}/theme" ]; }; }; }