Unverified Commit 1e788edb authored by John Titor's avatar John Titor
Browse files

hyprlandPlugins.mkHyprlandPlugin: support finalAttrs through lib.extendMkDerivation

parent ac802288
Loading
Loading
Loading
Loading
+23 −11
Original line number Diff line number Diff line
@@ -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; }
+3 −3
Original line number Diff line number Diff line
@@ -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
    ];
  };
}
})
+3 −4
Original line number Diff line number Diff line
{
  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
  };
}
})
+1 −2
Original line number Diff line number Diff line
@@ -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 −2
Original line number Diff line number Diff line
{
  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";

Loading