From 117cd71f52760eeb79cf24d6601a0c904726a8b2 Mon Sep 17 00:00:00 2001 From: macronova Date: Thu, 7 Mar 2024 21:25:29 -0800 Subject: [PATCH] Wallpaper engine plugin for Plasma6 --- flake.lock | 36 +++++++++++---- flake.nix | 6 ++- ...ix => wallpaper-engine-plasma5-plugin.nix} | 0 packages/wallpaper-engine-plasma6-plugin.nix | 46 +++++++++++++++++++ 4 files changed, 79 insertions(+), 9 deletions(-) rename packages/{wallpaper-engine-kde-plugin.nix => wallpaper-engine-plasma5-plugin.nix} (100%) create mode 100644 packages/wallpaper-engine-plasma6-plugin.nix diff --git a/flake.lock b/flake.lock index a7f1a3b..3e76265 100644 --- a/flake.lock +++ b/flake.lock @@ -5,11 +5,11 @@ "systems": "systems" }, "locked": { - "lastModified": 1705309234, - "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", + "lastModified": 1709126324, + "narHash": "sha256-q6EQdSeUZOG26WelxqkmR7kArjgWCdw5sfJVHPH/7j8=", "owner": "numtide", "repo": "flake-utils", - "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26", + "rev": "d465f4819400de7c8d874d50b982301f28a84605", "type": "github" }, "original": { @@ -20,11 +20,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1708475490, - "narHash": "sha256-g1v0TsWBQPX97ziznfJdWhgMyMGtoBFs102xSYO4syU=", + "lastModified": 1709703039, + "narHash": "sha256-6hqgQ8OK6gsMu1VtcGKBxKQInRLHtzulDo9Z5jxHEFY=", "owner": "nixos", "repo": "nixpkgs", - "rev": "0e74ca98a74bc7270d28838369593635a5db3260", + "rev": "9df3e30ce24fd28c7b3e2de0d986769db5d6225d", "type": "github" }, "original": { @@ -38,7 +38,8 @@ "inputs": { "flake-utils": "flake-utils", "nixpkgs": "nixpkgs", - "wallpaper-engine-kde-plugin": "wallpaper-engine-kde-plugin", + "wallpaper-engine-plasma5-plugin": "wallpaper-engine-plasma5-plugin", + "wallpaper-engine-plasma6-plugin": "wallpaper-engine-plasma6-plugin", "yorha-grub-theme": "yorha-grub-theme", "yorha-sound-theme": "yorha-sound-theme" } @@ -58,7 +59,7 @@ "type": "github" } }, - "wallpaper-engine-kde-plugin": { + "wallpaper-engine-plasma5-plugin": { "flake": false, "locked": { "lastModified": 1708352840, @@ -76,6 +77,25 @@ "url": "https://github.com/catsout/wallpaper-engine-kde-plugin" } }, + "wallpaper-engine-plasma6-plugin": { + "flake": false, + "locked": { + "lastModified": 1709859681, + "narHash": "sha256-umQ1R+XenuNze2xdFGauQZ/an6Q0zN/BG/8TDQsV0jM=", + "ref": "qt6", + "rev": "8a111b99405bd092974cd9bac654a83d4c3e86c2", + "revCount": 590, + "submodules": true, + "type": "git", + "url": "https://github.com/catsout/wallpaper-engine-kde-plugin" + }, + "original": { + "ref": "qt6", + "submodules": true, + "type": "git", + "url": "https://github.com/catsout/wallpaper-engine-kde-plugin" + } + }, "yorha-grub-theme": { "flake": false, "locked": { diff --git a/flake.nix b/flake.nix index 15ef4e5..4e2aa5e 100644 --- a/flake.nix +++ b/flake.nix @@ -4,10 +4,14 @@ inputs = { flake-utils.url = "github:numtide/flake-utils"; nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; - wallpaper-engine-kde-plugin = { + wallpaper-engine-plasma5-plugin = { flake = false; url = "git+https://github.com/catsout/wallpaper-engine-kde-plugin?submodules=1"; }; + wallpaper-engine-plasma6-plugin = { + flake = false; + url = "git+https://github.com/catsout/wallpaper-engine-kde-plugin?ref=qt6&submodules=1"; + }; yorha-grub-theme = { flake = false; url = "github:OliveThePuffin/yorha-grub-theme"; diff --git a/packages/wallpaper-engine-kde-plugin.nix b/packages/wallpaper-engine-plasma5-plugin.nix similarity index 100% rename from packages/wallpaper-engine-kde-plugin.nix rename to packages/wallpaper-engine-plasma5-plugin.nix diff --git a/packages/wallpaper-engine-plasma6-plugin.nix b/packages/wallpaper-engine-plasma6-plugin.nix new file mode 100644 index 0000000..029b084 --- /dev/null +++ b/packages/wallpaper-engine-plasma6-plugin.nix @@ -0,0 +1,46 @@ +{ inputs, name, pkgs }: + +pkgs.kdePackages.callPackage + ( + { extra-cmake-modules + , full + , kpackage + , libplasma + , lz4 + , mkKdeDerivation + , mpv + , pkg-config + , python-ws + }: + + mkKdeDerivation { + extraBuildInputs = [ + extra-cmake-modules + full + libplasma + lz4 + mpv + ]; + extraCmakeFlags = [ "-DUSE_PLASMAPKG=ON" ]; + extraNativeBuildInputs = [ + kpackage + pkg-config + ]; + pname = name; + postInstall = '' + sed -i "16i \\ \"[ -f \\\\\"\$HOME/.nix-profile/share/\$EXT\\\\\" ] && WKD=\\\\\"\$HOME/.nix-profile/share/\$EXT\\\\\"\"," ../plugin/contents/ui/Pyext.qml + sed -i "s/exec python3 //g" ../plugin/contents/ui/Pyext.qml + chmod +x ../plugin/contents/pyext.py + PATH=${python-ws}/bin:$PATH patchShebangs --build ../plugin/contents/pyext.py + kpackagetool6 -i ../plugin/ -p $out/share/plasma/wallpapers/ + ''; + src = inputs.${name}; + version = "latest"; + } + ) + { + python-ws = pkgs.python3.withPackages (ps: with ps; [ + websockets + ]); + } +