{ user ? throw "user argument is required" }: { config, lib, pkgs, ... }: let hmConfig = config.home-manager.users."${user.name}"; in { home-manager.users."${user.name}" = { home = { packages = with pkgs; [ swww ]; persistence."/cache${user.home}".directories = [ "${hmConfig.xdg.relativeCacheHome}/swww" ]; }; wayland.windowManager.hyprland.initExtraConfig = let name = "init-swww"; in "${pkgs.writeShellApplication { inherit name; runtimeInputs = with pkgs; [ swww ]; text = '' swww-daemon &> /tmp/swww.log ''; }}/bin/${name} &"; theme.extraConfig = let name = "theme-swww"; in lib.mkAfter "${pkgs.writeShellApplication { inherit name; runtimeInputs = with pkgs; [ coreutils-full procps swww ]; text = '' while ! swww query &> /dev/null; do sleep 0.1 done swww img "${hmConfig.theme.configDir}/wallpaper" ''; }}/bin/${name} &"; }; }