Set wallpaper on KDE Plasma

I wanted to set the Wallpaper of my KDE Plasma automatically, and ive red that you can simply move a png into $HOME/.background-image. I made a bash script to automatically move he file there, and set its rights to 655 the file is there too. However the wallpaper doesnt change. Even after a reboot.

So the nix integration of KDE essentially non existing.
S I don’t know how KDE works in terms of wallpapers. But for coping files you can use Home Manager with home.file:

  home.file = {
    ".config/lvim/config.lua".source = ./programs/lvim/config.lua;
    ".config/ghostty/config".source = ./programs/ghostty/config;
    "scripts"= {source = ./scripts;
                executable = true;
              };
  };  

However for the wallpaper I would highly recommend to check out Stylix. This is a styling module for Nixos. With that you can manage Wallpapers, Icons, Fonts and color Schemes systemwide.

Other solution i tought worked didnt end up working after all … so here is what actually worked:

systemd.user.services.set-wallpaper = {
      description = "Set KDE Plasma wallpaper";
      serviceConfig.ExecStart = [ "/run/current-system/sw/bin/plasma-apply-wallpaperimage /etc/nixos/other/wallpaper.png" ];
      wantedBy = [ "graphical-session.target" ];
    };

I put this in my configuration.nix (I had to us absolute path as it wouldnt recongnize the command otherwise) Any improvements appreceated ^^