{ lib, config, pkgs, flakeRoot, user, ... }: let script_path = "${flakeRoot}/assets/hyprland/scripts/copy_wallpaperstuff.sh"; wallpaper_conf = "${flakeRoot}/assets/hyprland/wallpaperstuff/wallpaper.conf"; in { options.wallpaper.enable = lib.mkEnableOption "Wallpaper setup"; config = lib.mkIf config.wallpaper.enable { home-manager.users.${user.username} = { # Install wpaperd home.packages = with pkgs; [ wpaperd ]; # Make script available in home home.file."copy_wallpaperstuff.sh" = { source = script_path; executable = true; }; # Activation script home.activation.copy-wallpapers = lib.hm.dag.entryAfter [ "writeBoundary" ] '' echo "=== Activation Script Running ===" if [ -f "$HOME/copy_wallpaperstuff.sh" ]; then echo "Executing wallpaper script..." "$HOME/copy_wallpaperstuff.sh" else echo "ERROR: Script not found in home" fi ''; # wpaperd config xdg.configFile."wpaperd/config.toml".text = builtins.readFile wallpaper_conf; }; }; }