{ lib, config, pkgs, flakeRoot, user, ... }: let cfg = config.wallpaper; sourceDir = "${flakeRoot}/assets/hyprland/wallpaperstuff"; targetDir = "/home/${user.username}/Droidnix/wallpaperstuff"; in { options.wallpaper.enable = lib.mkEnableOption "Wallpaper setup"; config = lib.mkIf cfg.enable { home-manager.users.${user.username} = { # # ✅ Install wpaperd # home.packages = with pkgs; [ wpaperd ]; # # ✅ Ensure config exists # xdg.configFile."wpaperd/config.toml".source = "${sourceDir}/wallpaper.conf"; # # 🔥 One-time (non-destructive) copy # home.activation.setupWallpapers = lib.hm.dag.entryAfter [ "writeBoundary" ] '' echo "=== Wallpaper setup ===" mkdir -p "${targetDir}" if [ ! -d "${targetDir}/pictures" ]; then echo "Initializing wallpaper directory..." cp -r ${sourceDir}/* "${targetDir}/" else echo "Wallpaper directory already exists, skipping copy" fi ''; }; }; }