about summary refs log tree commit diff
path: root/pkgs/applications/window-managers/hyprwm/hyprland-plugins/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/applications/window-managers/hyprwm/hyprland-plugins/default.nix')
-rw-r--r--pkgs/applications/window-managers/hyprwm/hyprland-plugins/default.nix73
1 files changed, 29 insertions, 44 deletions
diff --git a/pkgs/applications/window-managers/hyprwm/hyprland-plugins/default.nix b/pkgs/applications/window-managers/hyprwm/hyprland-plugins/default.nix
index 859ddf6dcecc0..f994b19175209 100644
--- a/pkgs/applications/window-managers/hyprwm/hyprland-plugins/default.nix
+++ b/pkgs/applications/window-managers/hyprwm/hyprland-plugins/default.nix
@@ -1,50 +1,35 @@
-{ lib
-, callPackage
-, pkg-config
-, stdenv
-, hyprland
+{
+  lib,
+  callPackage,
+  pkg-config,
+  stdenv,
+  hyprland,
 }:
 let
-  mkHyprlandPlugin = hyprland:
+  mkHyprlandPlugin =
+    hyprland:
     args@{ pluginName, ... }:
-    stdenv.mkDerivation (args // {
-      pname = "${pluginName}";
-      nativeBuildInputs = [ pkg-config ] ++ args.nativeBuildInputs or [ ];
-      buildInputs = [ hyprland ]
-        ++ hyprland.buildInputs
-        ++ (args.buildInputs or [ ]);
-      meta = args.meta // {
-        description = args.meta.description or "";
-        longDescription = (args.meta.longDescription or "") +
-          "\n\nPlugins can be installed via a plugin entry in the Hyprland NixOS or Home Manager options.";
-      };
-    });
-
-  plugins = {
-    hy3 = { fetchFromGitHub, cmake, hyprland }:
-      mkHyprlandPlugin hyprland rec {
-        pluginName = "hy3";
-        version = "0.41.0";
-
-        src = fetchFromGitHub {
-          owner = "outfoxxed";
-          repo = "hy3";
-          rev = "hl${version}";
-          hash = "sha256-gEEWWlQRvejSR2RRg78Lubz6siIgknqj6CslveyyIP4=";
+    stdenv.mkDerivation (
+      args
+      // {
+        pname = "${pluginName}";
+        nativeBuildInputs = [ pkg-config ] ++ args.nativeBuildInputs or [ ];
+        buildInputs = [ hyprland ] ++ hyprland.buildInputs ++ (args.buildInputs or [ ]);
+        meta = args.meta // {
+          description = args.meta.description or "";
+          longDescription =
+            (args.meta.longDescription or "")
+            + "\n\nPlugins can be installed via a plugin entry in the Hyprland NixOS or Home Manager options.";
         };
+      }
+    );
 
-        nativeBuildInputs = [ cmake ];
-
-        dontStrip = true;
-
-        meta = {
-          homepage = "https://github.com/outfoxxed/hy3";
-          description = "Hyprland plugin for an i3 / sway like manual tiling layout";
-          license = lib.licenses.gpl3;
-          platforms = lib.platforms.linux;
-          maintainers = with lib.maintainers; [ aacebedo ];
-        };
-      };
-  };
+  plugins = lib.mergeAttrsList [
+    { hy3 = import ./hy3.nix; }
+    (import ./hyprland-plugins.nix)
+  ];
 in
-(lib.mapAttrs (name: plugin: callPackage plugin { }) plugins) // { inherit mkHyprlandPlugin; }
+(lib.mapAttrs (name: plugin: callPackage plugin { inherit mkHyprlandPlugin; }) plugins)
+// {
+  inherit mkHyprlandPlugin;
+}