Subject: [PATCH 1/4] gnu: Add Hyprland plugins.

From: Andrew Wong <[email-masked]>
Date: Mon, 10 Mar 2025 00:26:40 -0400

* gnu/packages/wm.scm (hyprland-plugin): New function.
* gnu/packages/wm.scm (borders-plus-plus): New variable.
* gnu/packages/wm.scm (csgo-vulkan-fix): New variable.
* gnu/packages/wm.scm (hyprbars): New variable.
* gnu/packages/wm.scm (hyprexpo): New variable.
* gnu/packages/wm.scm (hyprtrails): New variable.
* gnu/packages/wm.scm (hyprwinwrap): New variable.
* gnu/packages/wm.scm (xtra-dispatchers): New variable.

Change-Id: I923095e0d0cbc1c237e55a78dd2e9c1b1a3235df
---
 gnu/packages/wm.scm | 75 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 75 insertions(+)

diff --git a/gnu/packages/wm.scm b/gnu/packages/wm.scm
index a0b6c6f40a..0cfd2c99d4 100644
--- a/gnu/packages/wm.scm
+++ b/gnu/packages/wm.scm
@@ -443,6 +443,81 @@ (define-public hyprland
 its looks.")
     (license license:bsd-3)))
 
+(define hyprland-plugin
+  (lambda (plugin-name plugin-provision)
+    "Generate a packaged plugin from Hyprland's official plugin repository."
+    (package
+      (name plugin-name)
+      (version "0.47.0")
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url "https://github.com/hyprwm/hyprland-plugins")
+                      (commit (string-append "v" version))))
+                (file-name (git-file-name name version))
+                (sha256
+                 (base32
+                  "06jydclvivd7xq0kwn6s19jhmmfqc5q649z7w4wqqj6jdhgkhayg"))))
+      (build-system cmake-build-system)
+      (native-inputs (list gcc-14 pkg-config))
+      (inputs (list hyprland
+                    libdrm
+                    libinput
+                    eudev
+                    pango
+                    pixman
+                    wayland
+                    libxkbcommon
+                    mesa
+                    hyprutils
+                    hyprgraphics
+                    aquamarine
+                    hyprlang))
+      (arguments (list #:cmake cmake-3.30
+                       #:tests? #f      ; no tests.
+                       #:phases
+                       #~(modify-phases %standard-phases
+                           (add-after 'unpack 'chdir
+                             (lambda _ (chdir #$plugin-name)))
+                           (replace 'install-license-files
+                             (lambda _ (install-file
+                                        "../LICENSE"
+                                        (string-append #$output "/share/doc/"
+                                                       #$name "-"
+                                                       #$version)))))))
+      (home-page (string-append "https://github.com/hyprwm/hyprland-plugins/"
+                                plugin-name))
+      (synopsis (string-append "Hyprland plugin providing "
+                               plugin-provision))
+      (description
+       (string-append "This is an official Hyprland plugin that provides "
+                      plugin-provision "."))
+      (license license:bsd-3))))
+
+(define-public borders-plus-plus
+  (hyprland-plugin "borders-plus-plus" "extra borders around windows"))
+
+(define-public csgo-vulkan-fix
+  (let ((parent (hyprland-plugin "csgo-vulkan-fix"
+                                 "virtual native resolution reporting")))
+    (package (inherit parent) (inputs (modify-inputs (package-inputs parent)
+                                        (append xcb-util-wm))))))
+
+(define-public hyprbars
+  (hyprland-plugin "hyprbars" "window title bars"))
+
+(define-public hyprexpo
+  (hyprland-plugin "hyprexpo" "an exposé feature"))
+
+(define-public hyprtrails
+  (hyprland-plugin "hyprtrails" "trail effects behind windows"))
+
+(define-public hyprwinwrap
+  (hyprland-plugin "hyprwinwrap" "a window-as-wallpaper feature"))
+
+(define-public xtra-dispatchers
+  (hyprland-plugin "xtra-dispatchers" "extra dispatchers"))
+
 (define-public i3status
   (package
     (name "i3status")
-- 
2.48.1