hyprlandPlugins.mkHyprlandPlugin: support finalAttrs through lib.extendMkDerivation

This commit is contained in:
John Titor
2025-09-15 12:07:18 +05:30
parent ac802288a3
commit 1e788edb89
8 changed files with 36 additions and 32 deletions
@@ -3,25 +3,37 @@
lib,
callPackage,
pkg-config,
}:
hyprland,
}@topLevelArgs:
let
mkHyprlandPlugin =
hyprland:
args@{ pluginName, ... }:
hyprland.stdenv.mkDerivation (
args
// {
mkHyprlandPlugin = lib.extendMkDerivation {
constructDrv = topLevelArgs.hyprland.stdenv.mkDerivation;
extendDrvArgs =
finalAttrs:
{
pluginName ? "",
nativeBuildInputs ? [ ],
buildInputs ? [ ],
hyprland ? topLevelArgs.hyprland,
...
}@args:
{
pname = "${pluginName}";
nativeBuildInputs = [ pkg-config ] ++ args.nativeBuildInputs or [ ];
buildInputs = [ hyprland ] ++ hyprland.buildInputs ++ (args.buildInputs or [ ]);
nativeBuildInputs = [ pkg-config ] ++ nativeBuildInputs;
buildInputs = [ hyprland ] ++ hyprland.buildInputs ++ buildInputs;
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.";
platforms = args.meta.platforms or hyprland.meta.platforms or [ ];
};
}
);
};
};
plugins = lib.mergeAttrsList [
{ hy3 = import ./hy3.nix; }
@@ -6,14 +6,14 @@
mkHyprlandPlugin,
nix-update-script,
}:
mkHyprlandPlugin hyprland rec {
mkHyprlandPlugin (finalAttrs: {
pluginName = "hy3";
version = "hl0.50.0";
src = fetchFromGitHub {
owner = "outfoxxed";
repo = "hy3";
tag = version;
tag = finalAttrs.version;
hash = "sha256-1BTJSqkj+lkIry27HuqA5UB7uRqAUvGT7LAUDQhKjU0=";
};
@@ -33,4 +33,4 @@ mkHyprlandPlugin hyprland rec {
johnrtitor
];
};
}
})
@@ -1,20 +1,19 @@
{
lib,
mkHyprlandPlugin,
hyprland,
cmake,
fetchFromGitHub,
nix-update-script,
}:
mkHyprlandPlugin hyprland rec {
mkHyprlandPlugin (finalAttrs: {
pluginName = "hycov";
version = "0.41.2.1";
src = fetchFromGitHub {
owner = "DreamMaoMao";
repo = "hycov";
rev = version;
tag = finalAttrs.version;
hash = "sha256-NRnxbkuiq1rQ+uauo7D+CEe73iGqxsWxTQa+1SEPnXQ=";
};
@@ -30,4 +29,4 @@ mkHyprlandPlugin hyprland rec {
platforms = lib.platforms.linux;
broken = true; # Doesn't work after Hyprland v0.41.2 https://gitee.com/DreamMaoMao/hycov/issues/IANYC8#note_31512295_link
};
}
})
@@ -2,11 +2,10 @@
lib,
mkHyprlandPlugin,
fetchFromGitHub,
hyprland,
nix-update-script,
}:
mkHyprlandPlugin hyprland {
mkHyprlandPlugin {
pluginName = "hypr-dynamic-cursors";
version = "0-unstable-2025-09-01";
@@ -1,7 +1,6 @@
{
lib,
mkHyprlandPlugin,
hyprland,
fetchFromGitHub,
cmake,
doctest,
@@ -11,7 +10,7 @@
nix-update-script,
}:
mkHyprlandPlugin hyprland {
mkHyprlandPlugin {
pluginName = "hyprgrass";
version = "0.8.2-unstable-2025-05-08";
@@ -10,7 +10,6 @@ let
lib,
cmake,
fetchFromGitHub,
hyprland,
mkHyprlandPlugin,
}:
let
@@ -23,7 +22,7 @@ let
hash = "sha256-XJJ+frO4NOxVkoSGc1Mag8ESumzx2FmVRspOgFlMqF8=";
};
in
mkHyprlandPlugin hyprland {
mkHyprlandPlugin {
pluginName = name;
inherit version;
@@ -34,7 +33,6 @@ let
description = "Hyprland ${description} plugin";
license = lib.licenses.bsd3;
teams = [ lib.teams.hyprland ];
inherit (hyprland.meta) platforms;
};
}
)
@@ -1,12 +1,11 @@
{
lib,
fetchFromGitHub,
hyprland,
mkHyprlandPlugin,
nix-update-script,
}:
mkHyprlandPlugin hyprland {
mkHyprlandPlugin {
pluginName = "hyprspace";
version = "0-unstable-2025-07-16";
@@ -2,19 +2,18 @@
lib,
meson,
fetchFromGitHub,
hyprland,
ninja,
mkHyprlandPlugin,
nix-update-script,
}:
mkHyprlandPlugin hyprland rec {
mkHyprlandPlugin (finalAttrs: {
pluginName = "hyprsplit";
version = "0.50.1";
src = fetchFromGitHub {
owner = "shezdy";
repo = "hyprsplit";
tag = "v${version}";
tag = "v${finalAttrs.version}";
hash = "sha256-D0zfdUJXBRnNMmv/5qW+X4FJJ3/+t7yQmwJFkBuEgck=";
};
@@ -29,9 +28,8 @@ mkHyprlandPlugin hyprland rec {
homepage = "https://github.com/shezdy/hyprsplit";
description = "Hyprland plugin for awesome / dwm like workspaces";
license = lib.licenses.bsd3;
inherit (hyprland.meta) platforms;
maintainers = with lib.maintainers; [
aacebedo
];
};
}
})