Wallpaper Engine on NixOS (wallpaper-engine-kde-plugin)

Sorry for not coming back for a while on this :sweat_smile:. Both the generic user detection and the new script works great. I still had some issues with having the python websocket module be recognized properly so I did add it outside of the configuration (in extra of what is already in the configuration (maybe I just ) so it is available user-wide. Even someone commented on my gist about that. Actually I retested and even when removing that module outside the config, it works. So I might have done something wrong in the past.

Anyway, I think that it would be possible to automate it but I think I’d like the maintainer take on it too. I will create an issue on their github if they are interested of automating it if I provide some help on the config (maybe getting to nixpkgs) or if it is better to keep it independent (either pushing it to nixpkgs still or simply providing it as a flake).

Also I added a check if the symlink already exist to prevent script failure:

wallpaper-engine-kde-plugin.text = ''
        wallpaperenginetarget=/share/plasma/wallpapers/com.github.catsout.wallpaperEngineKde
        mkdir -p /home/${builtins.head (builtins.attrNames config.users.users)}/.local/share/plasma/wallpapers
        chown -R ${builtins.head (builtins.attrNames config.users.users)}:users /home/${builtins.head (builtins.attrNames config.users.users)}/.local/share/plasma
        if [ ! -e /home/${builtins.head (builtins.attrNames config.users.users)}/.local$wallpaperenginetarget ]; then
          ln -sf ${wallpaper-engine-kde-plugin}/$wallpaperenginetarget /home/${builtins.head (builtins.attrNames config.users.users)}/.local/$wallpaperenginetarget
        fi;
      '';

Wait I just saw that there was actually a package that was uploaded to nixpkgs very recently (opened last August and merged 2 weeks ago) but only on the unstable branch. I personally cannot test it right now, but their solution seems quite more complicated than what we are doing here.

Issue on main repo: [Feature Request] Nix Package · Issue #459 · catsout/wallpaper-engine-kde-plugin · GitHub
PR on nixpkgs: kdePackages.wallpaper-engine-plugin: init at 0.5.5-unstable-2024-06-16 by Sicheng-Pan · Pull Request #334984 · NixOS/nixpkgs · GitHub