From 8e6784a241cb784bab30abbc387232b082db926b Mon Sep 17 00:00:00 2001 From: Mihai Fufezan Date: Fri, 21 Jun 2024 21:48:36 +0300 Subject: [PATCH 1/3] hyprlandPlugins.hy3: move to separate file Format with nixfmt-rfc-style. --- .../hyprwm/hyprland-plugins/default.nix | 70 +++++++------------ .../hyprwm/hyprland-plugins/hy3.nix | 30 ++++++++ 2 files changed, 57 insertions(+), 43 deletions(-) create mode 100644 pkgs/applications/window-managers/hyprwm/hyprland-plugins/hy3.nix diff --git a/pkgs/applications/window-managers/hyprwm/hyprland-plugins/default.nix b/pkgs/applications/window-managers/hyprwm/hyprland-plugins/default.nix index 859ddf6dcecc..b5cf42a8148a 100644 --- a/pkgs/applications/window-managers/hyprwm/hyprland-plugins/default.nix +++ b/pkgs/applications/window-managers/hyprwm/hyprland-plugins/default.nix @@ -1,50 +1,34 @@ -{ 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."; - }; - }); + 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="; - }; - - 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 ]; - }; - }; + hy3 = import ./hy3.nix; }; in -(lib.mapAttrs (name: plugin: callPackage plugin { }) plugins) // { inherit mkHyprlandPlugin; } +(lib.mapAttrs (name: plugin: callPackage plugin { inherit mkHyprlandPlugin; }) plugins) +// { + inherit mkHyprlandPlugin; +} diff --git a/pkgs/applications/window-managers/hyprwm/hyprland-plugins/hy3.nix b/pkgs/applications/window-managers/hyprwm/hyprland-plugins/hy3.nix new file mode 100644 index 000000000000..88bf78b6f667 --- /dev/null +++ b/pkgs/applications/window-managers/hyprwm/hyprland-plugins/hy3.nix @@ -0,0 +1,30 @@ +{ + lib, + cmake, + fetchFromGitHub, + hyprland, + mkHyprlandPlugin, +}: +mkHyprlandPlugin hyprland rec { + pluginName = "hy3"; + version = "0.41.0"; + + src = fetchFromGitHub { + owner = "outfoxxed"; + repo = "hy3"; + rev = "hl${version}"; + hash = "sha256-gEEWWlQRvejSR2RRg78Lubz6siIgknqj6CslveyyIP4="; + }; + + 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 ]; + }; +} From ef64bb49153eb638d2bc16b9c5ec4fff7940a0e4 Mon Sep 17 00:00:00 2001 From: Mihai Fufezan Date: Sat, 22 Jun 2024 20:59:56 +0300 Subject: [PATCH 2/3] hyprlandPlugins.hy3: 0.41.0 -> 0.41.1 --- .../window-managers/hyprwm/hyprland-plugins/hy3.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/window-managers/hyprwm/hyprland-plugins/hy3.nix b/pkgs/applications/window-managers/hyprwm/hyprland-plugins/hy3.nix index 88bf78b6f667..acb4aa2d322c 100644 --- a/pkgs/applications/window-managers/hyprwm/hyprland-plugins/hy3.nix +++ b/pkgs/applications/window-managers/hyprwm/hyprland-plugins/hy3.nix @@ -7,13 +7,13 @@ }: mkHyprlandPlugin hyprland rec { pluginName = "hy3"; - version = "0.41.0"; + version = "0.41.1"; src = fetchFromGitHub { owner = "outfoxxed"; repo = "hy3"; rev = "hl${version}"; - hash = "sha256-gEEWWlQRvejSR2RRg78Lubz6siIgknqj6CslveyyIP4="; + hash = "sha256-bRLI+zgfT31LCMW4Pf701ZZx2oFeXoBu1BfYQjX6MPc="; }; nativeBuildInputs = [ cmake ]; From cf7b89e9a6705d6c7c920d7a16cf758092d85202 Mon Sep 17 00:00:00 2001 From: Mihai Fufezan Date: Fri, 21 Jun 2024 22:08:44 +0300 Subject: [PATCH 3/3] hyprlandPlugins: init upstream hyprland-plugins at 0.41.1 --- .../hyprwm/hyprland-plugins/default.nix | 7 +-- .../hyprland-plugins/hyprland-plugins.nix | 51 +++++++++++++++++++ 2 files changed, 55 insertions(+), 3 deletions(-) create mode 100644 pkgs/applications/window-managers/hyprwm/hyprland-plugins/hyprland-plugins.nix diff --git a/pkgs/applications/window-managers/hyprwm/hyprland-plugins/default.nix b/pkgs/applications/window-managers/hyprwm/hyprland-plugins/default.nix index b5cf42a8148a..f994b1917520 100644 --- a/pkgs/applications/window-managers/hyprwm/hyprland-plugins/default.nix +++ b/pkgs/applications/window-managers/hyprwm/hyprland-plugins/default.nix @@ -24,9 +24,10 @@ let } ); - plugins = { - hy3 = import ./hy3.nix; - }; + plugins = lib.mergeAttrsList [ + { hy3 = import ./hy3.nix; } + (import ./hyprland-plugins.nix) + ]; in (lib.mapAttrs (name: plugin: callPackage plugin { inherit mkHyprlandPlugin; }) plugins) // { diff --git a/pkgs/applications/window-managers/hyprwm/hyprland-plugins/hyprland-plugins.nix b/pkgs/applications/window-managers/hyprwm/hyprland-plugins/hyprland-plugins.nix new file mode 100644 index 000000000000..8ae5348e997c --- /dev/null +++ b/pkgs/applications/window-managers/hyprwm/hyprland-plugins/hyprland-plugins.nix @@ -0,0 +1,51 @@ +let + # shared src for upstream hyprland-plugins repo + # function generating derivations for all plugins in hyprland-plugins + hyprland-plugins = + builtins.mapAttrs + ( + name: description: + ( + { + lib, + cmake, + fetchFromGitHub, + hyprland, + mkHyprlandPlugin, + }: + let + version = "0.41.1"; + + hyprland-plugins-src = fetchFromGitHub { + owner = "hyprwm"; + repo = "hyprland-plugins"; + rev = "v${version}"; + hash = "sha256-Bw3JRBUZg2kmDwxa/UHvD//gGcNjbftTj2MSeLvx1q8="; + }; + in + mkHyprlandPlugin hyprland { + pluginName = name; + inherit version; + + src = "${hyprland-plugins-src}/${name}"; + nativeBuildInputs = [ cmake ]; + meta = { + homepage = "https://github.com/hyprwm/hyprland-plugins"; + description = "Hyprland ${description} plugin"; + license = lib.licenses.bsd3; + maintainers = with lib.maintainers; [ fufexan ]; + platforms = lib.platforms.linux; + }; + } + ) + ) + { + borders-plus-plus = "multiple borders"; + csgo-vulkan-fix = "CS:GO/CS2 Vulkan fix"; + hyprbars = "window title"; + hyprexpo = "workspaces overview"; + hyprtrails = "smooth trails behind moving windows"; + hyprwinwrap = "xwinwrap-like"; + }; +in +hyprland-plugins