about summary refs log tree commit diff
path: root/pkgs/misc
diff options
context:
space:
mode:
authoréclairevoyant <848000+eclairevoyant@users.noreply.github.com>2024-04-17 14:06:51 +0000
committerGitHub <noreply@github.com>2024-04-17 11:06:51 -0300
commit4dcd08c9d4c84e2f5d94bc0344bdfd55f876ce0e (patch)
tree00bc4f1b4f060b855def7a19536645efd0b577a3 /pkgs/misc
parente7318026c815e9cfeccd5c4cdadf378df26eace0 (diff)
plasmahud: fix runtime errors and other cleanup (#271479)
* plasma-hud: fix runtime errors

* plasma-hud: clean up installPhase

* plasma-hud: fix scoping for `propagatedBuildInputs`

* plasma-hud: formatting

* plasma-hud: clean up src

* plasma-hud: remove `with lib;`

* plasma-hud: fix potential splicing issue (see #211340)
Diffstat (limited to 'pkgs/misc')
-rw-r--r--pkgs/misc/plasma-hud/default.nix48
1 files changed, 30 insertions, 18 deletions
diff --git a/pkgs/misc/plasma-hud/default.nix b/pkgs/misc/plasma-hud/default.nix
index c0cf771da8499..b0adf0e1efc69 100644
--- a/pkgs/misc/plasma-hud/default.nix
+++ b/pkgs/misc/plasma-hud/default.nix
@@ -1,42 +1,54 @@
-{ lib, python3, fetchFromGitHub, rofi, gobject-introspection }:
+{ wrapGAppsHook
+, lib
+, python3Packages
+, fetchFromGitHub
+, rofi
+, gobject-introspection
+}:
 
-python3.pkgs.buildPythonApplication rec{
+python3Packages.buildPythonApplication rec {
   pname = "plasma-hud";
   version = "19.10.1";
+  format = "other";
 
   src = fetchFromGitHub {
     owner = "Zren";
-    repo = pname;
+    repo = "plasma-hud";
     rev = version;
-    sha256 = "19vlc156jfdamw7q1pc78fmlf0h3sff5ar3di9j316vbb60js16l";
+    hash = "sha256-1AQtgVlrmzBkim1kVZzTAwJHq0OH3YAPr6o5aUpgdKc=";
   };
 
-  propagatedBuildInputs = with python3.pkgs; [
-    rofi
+  nativeBuildInputs = [
+    gobject-introspection
+    wrapGAppsHook
+  ];
+
+  propagatedBuildInputs = (with python3Packages; [
     dbus-python
+    pygobject3
     setproctitle
     xlib
-    pygobject3
-    gobject-introspection
-  ];
-  format = "other";
+  ]) ++ [ rofi ];
+
   postPatch = ''
     sed -i "s:/usr/lib/plasma-hud:$out/bin:" etc/xdg/autostart/plasma-hud.desktop
   '';
 
   installPhase = ''
-    patchShebangs $out/bin/plasma-hud
-    mkdir -p $out/bin $out/etc/xdg/autostart
-    cp -r $src/usr/lib/plasma-hud/plasma-hud $out/bin/plasma-hud
-    cp -r $src/etc $out/etc
+    runHook preInstall
+
+    install -Dm555 usr/lib/plasma-hud/plasma-hud -t $out/bin
+    cp -r etc -t $out
+
+    runHook postInstall
   '';
 
-  meta = with lib;{
-    license = licenses.gpl2Only;
+  meta = {
+    license = lib.licenses.gpl2Only;
     homepage = "https://github.com/Zren/plasma-hud";
-    platforms = platforms.unix;
+    platforms = lib.platforms.unix;
     description = "Run menubar commands, much like the Unity 7 Heads-Up Display (HUD)";
-    maintainers = with maintainers; [ pasqui23 ];
+    maintainers = with lib.maintainers; [ pasqui23 ];
     mainProgram = "plasma-hud";
   };
 }