Skip to content

Instantly share code, notes, and snippets.

@BBArikL
Last active April 29, 2025 16:06
Show Gist options
  • Save BBArikL/b389c4592d636380523e03ac423b77b3 to your computer and use it in GitHub Desktop.
Save BBArikL/b389c4592d636380523e03ac423b77b3 to your computer and use it in GitHub Desktop.
wallpaper-engine-kde-plugin on NixOS
{ config, lib, pkgs, ...}:
let
# References: https://github.com/xerhaxs/nixos/blob/main/nixosModules/pkgs/wallpaper-engine-kde-plugin.nix and https://discourse.nixos.org/t/wallpaper-engine-on-nixos-wallpaper-engine-kde-plugin/19744/25
glslang-submodule = with pkgs; stdenv.mkDerivation {
name = "glslang";
installPhase = ''
mkdir -p $out
'';
src = fetchFromGitHub {
owner = "KhronosGroup";
repo = "glslang";
rev = "c34bb3b6c55f6ab084124ad964be95a699700d34";
sha256 = "IMROcny+b5CpmzEfvKBYDB0QYYvqC5bq3n1S4EQ6sXc=";
};
};
wallpaper-engine-kde-plugin = with pkgs; stdenv.mkDerivation rec {
pname = "wallpaperEngineKde";
version = "96230de92f1715d3ccc5b9d50906e6a73812a00a";
src = fetchFromGitHub {
owner = "Jelgnum";
repo = "wallpaper-engine-kde-plugin";
rev = version;
hash = "sha256-vkWEGlDQpfJ3fAimJHZs+aX6dh/fLHSRy2tLEsgu/JU=";
fetchSubmodules = true;
};
nativeBuildInputs = [
cmake
kdePackages.extra-cmake-modules
glslang-submodule
pkg-config
gst_all_1.gst-libav
shaderc
ninja
];
buildInputs = [
mpv
lz4
vulkan-headers
vulkan-tools
vulkan-loader
]
++ (with kdePackages; with qt6Packages; [
qtbase
qt6.full
kpackage
kdeclarative
libplasma
qtwebsockets
qtwebengine
qtwebchannel
qtmultimedia
qtdeclarative
])
++ [(python3.withPackages (python-pkgs: [ python-pkgs.websockets ]))];
cmakeFlags = [ "-DUSE_PLASMAPKG=OFF" ];
dontWrapQtApps = true;
postPatch = ''
rm -rf src/backend_scene/third_party/glslang
ln -s ${glslang-submodule.src} src/backend_scene/third_party/glslang
'';
#Optional informations
meta = with lib; {
description = "Wallpaper Engine KDE plasma plugin";
homepage = "https://github.com/Jelgnum/wallpaper-engine-kde-plugin";
license = licenses.gpl2Plus;
platforms = platforms.linux;
};
};
in
{
options.nixos = {
pkgs.wallpaper-engine-kde-plugin = {
enable = lib.mkOption {
type = lib.types.bool;
default = false;
example = true;
description = "Enable wallpaper-engine-kde-plugin.";
};
};
};
config = lib.mkIf (config.nixos.pkgs.wallpaper-engine-kde-plugin.enable) {
environment.systemPackages = with pkgs; [
wallpaper-engine-kde-plugin
kdePackages.qtwebsockets
kdePackages.qtwebchannel
(python3.withPackages (python-pkgs: [ python-pkgs.websockets ]))
];
system.activationScripts = {
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;
'';
};
};
}
@qwbarch
Copy link

qwbarch commented Apr 11, 2025

Thanks for making this package!

OK, this error disappeared after use this config: https://github.com/xerhaxs/nixos/blob/main/nixosModules/pkgs/wallpaper-engine-kde-plugin.nix

I indeed needed this as well to make python run properly. Seems like video wallpapers run (after installing qtmultimediate) while all scene wallpapers have a black screen. Is that an issue with the packaging or the plugin itself? wallpaper-engine-kde-plugin seems to support scene wallpapers so I'm not sure if I'm just doing something wrong

@BBArikL
Copy link
Author

BBArikL commented Apr 29, 2025

Just a quick heads up. If you plan on upgrading from nixos stable to unstable and you still have this file, disable it! Something changed between the versions of plasma that makes it coredumps over and over again. You better use the one in the unstable nixpkgs repo.

@BBArikL
Copy link
Author

BBArikL commented Apr 29, 2025

Well the current unstable version (from the nixpkgs repo) does not work for me yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment