-
-
Save BBArikL/b389c4592d636380523e03ac423b77b3 to your computer and use it in GitHub Desktop.
{ 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; | |
''; | |
}; | |
}; | |
} |
OK, this error disappeared after use this config: https://github.com/xerhaxs/nixos/blob/main/nixosModules/pkgs/wallpaper-engine-kde-plugin.nix
yea my config is a little bit out of date. Its missing some python dependencies at line 58. I am mostly thinking of automating it in about a week for it to be accessible from the nixpkg store.
About the python error: I think this is mostly waiting for a plasma reboot because after another round of testing I do not have the python helper problem.
I'm also having the same error, I tried restarting twice but no change.
If you are on Nixos unstable , you might want to use the actual merged package NixOS/nixpkgs#334984. Even if NixOS is so pointed to reproducible builds with configs, sometimes it seems like stuff don't actually work the same. If you don't have python on your system, this might be a problem? Just guessing
The nixos package does patch the pyext.py script, that might be the problem that I do not tackle here.
So I solved the issue, though honestly I'm not sure why it works. I searched up my issue online, and found this post. But since I'm still a completely beginner to nix and nixos, I didn't know how to run the script it gives.
So I decided to follow the script manually. I found out the exact nix store path, and manually created a symlink between the two:
ln -sf /nix/store/g55hivkdl0vr5w7mw7d5cq41cl5nkm3r-wallpaperEngineKde-96230de92f1715d3ccc5b9d50906e6a73812a00a/share/plasma/wallpapers/com.github.catsout.wallpaperEngineKde/ ~/.local/share/plasma/wallpapers/com.github.catsout.wallpaperEngineKde
Restarted my system, and lo and behold, somehow now it works perfectly. I don't know if the store path would be the same for all systems, but for anyone with the same problem, the solution seems to be just manually create a symlink from ~/.local/share/plasma/wallpapers/
, pointing to the com.github.catsout.wallpaperEngineKde folder in the nix store path.
Probably not the best or most "Nix" solution, but it works.
@BBArikL, if I'm not mistaken, the very last line of your script should be doing the same thing, but somehow it doesn't seem to be working? Maybe the file path is wrong, or the if statement is messing something up?
Hey! Yes the store path is different between each system and each nix generation (its basically a hash that is derived from your system configuration). Before, I was not using a leading /
for the wallpaper engine target, but I was corrected by people in that discourse thread to add that leading forward slash. I think I have an inconsistent usage of the $wallpaperenginetarget
. I'll make a new revision but I cannot test it right now. For people on nixos unstable, I'd recommend to go for the one in the official (nix) repo. If it ever comes on nixos stable, I will stop maintaining this gist and use the one which is in the nix repo.
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
A few notes:
$HOME/.local/share/plasma/wallpapers/
, follow the symlink, copy the targeted symlink and copy it back into$HOME/.local/share/plasma/wallpapers/
.config.nixos.system.user.defaultuser.name
. I could not find a generic way to do it if your configuration is not using that specific name, so I relied on thelogname
utility to find the user. Now, this means this package needs to be activated while the target user is logged in (or it might assume theroot
, but it still works if you run the nixos-rebuild as root). For most people I do not think this is too much too ask, but it might be a flaw for people who would want a perfect one config installation.