From c979d0efb4babbb00f8c52a27298804adc28355a Mon Sep 17 00:00:00 2001 From: Peter Hoeg Date: Wed, 6 Dec 2023 11:20:18 +0100 Subject: [PATCH] plasma5Packages.polonium: init at 0.6.0 --- .../plasma-5/3rdparty/addons/polonium.nix | 51 +++++++++++++++++++ pkgs/desktops/plasma-5/default.nix | 5 +- 2 files changed, 54 insertions(+), 2 deletions(-) create mode 100644 pkgs/desktops/plasma-5/3rdparty/addons/polonium.nix diff --git a/pkgs/desktops/plasma-5/3rdparty/addons/polonium.nix b/pkgs/desktops/plasma-5/3rdparty/addons/polonium.nix new file mode 100644 index 000000000000..7bfe963e0e8b --- /dev/null +++ b/pkgs/desktops/plasma-5/3rdparty/addons/polonium.nix @@ -0,0 +1,51 @@ +{ lib +, fetchFromGitHub +, buildNpmPackage +, plasma-framework +}: + +# how to update: +# 1. check out the tag for the version in question +# 2. run `prefetch-npm-deps package-lock.json` +# 3. update npmDepsHash with the output of the previous step + +buildNpmPackage rec { + pname = "polonium"; + version = "0.6.0"; + + src = fetchFromGitHub { + owner = "zeroxoneafour"; + repo = pname; + rev = "v" + version; + hash = "sha256-fZgNOcOq+owmqtplwnxeOIQpWmrga/WitCNCj89O5XA="; + }; + + npmDepsHash = "sha256-25AtM1FweWIbFot+HUMSPYTu47/0eKNpRWSlBEL0yKk="; + + dontConfigure = true; + + # the installer does a bunch of stuff that fails in our sandbox, so just build here and then we + # manually do the install + buildFlags = [ "res" "src" ]; + + nativeBuildInputs = [ plasma-framework ]; + + dontNpmBuild = true; + + dontWrapQtApps = true; + + installPhase = '' + runHook preInstall + + plasmapkg2 --install pkg --packageroot $out/share/kwin/scripts + + runHook postInstall + ''; + + meta = with lib; { + description = "Auto-tiler that uses KWin 5.27+ tiling functionality"; + license = licenses.mit; + maintainers = with maintainers; [ peterhoeg ]; + inherit (plasma-framework.meta) platforms; + }; +} diff --git a/pkgs/desktops/plasma-5/default.nix b/pkgs/desktops/plasma-5/default.nix index 0c501b4c5a4c..781bf1606709 100644 --- a/pkgs/desktops/plasma-5/default.nix +++ b/pkgs/desktops/plasma-5/default.nix @@ -49,7 +49,7 @@ let mirror = "mirror://kde"; }; - qtStdenv = libsForQt5.callPackage ({ stdenv }: stdenv) {}; + qtStdenv = libsForQt5.callPackage ({ stdenv }: stdenv) { }; packages = self: let @@ -96,7 +96,7 @@ let defaultSetupHook = if hasBin && hasDev then propagateBin else null; setupHook = args.setupHook or defaultSetupHook; - nativeBuildInputs = (args.nativeBuildInputs or []) ++ [ libsForQt5.wrapQtAppsHook ]; + nativeBuildInputs = (args.nativeBuildInputs or [ ]) ++ [ libsForQt5.wrapQtAppsHook ]; meta = let meta = args.meta or { }; in @@ -183,6 +183,7 @@ let kzones = callPackage ./3rdparty/kwin/scripts/kzones.nix { }; lightly = callPackage ./3rdparty/lightly { }; parachute = callPackage ./3rdparty/kwin/scripts/parachute.nix { }; + polonium = callPackage ./3rdparty/addons/polonium.nix { }; }; } // lib.optionalAttrs config.allowAliases {