diff --git a/hm/modules/linux/desktop-environment/hyprland/default.nix b/hm/modules/linux/desktop-environment/hyprland/default.nix index abc8bae..16f0faf 100644 --- a/hm/modules/linux/desktop-environment/hyprland/default.nix +++ b/hm/modules/linux/desktop-environment/hyprland/default.nix @@ -84,17 +84,7 @@ in wayland.windowManager.hyprland = { enable = true; - plugins = [ - (pkgs.hyprlandPlugins.hyprscroller.overrideAttrs { - version = "0-unstable-2025-03-28"; - src = pkgs.fetchFromGitHub { - owner = "cpiber"; - repo = "hyprscroller"; - rev = "de97924b6d1086d84939b6f6688637f7b21d8d80"; - hash = "sha256-m9689UH+w8Z/qP/DKYtzQfIGfiE4jgBAfO+uH34cfNs="; - }; - }) - ]; + plugins = [ pkgs.hyprlandPlugins.hyprscroller ]; settings = { exec-once = [ "hyprctl dispatch workspace 100000" diff --git a/pkgs/by-name/hyprscroller/default.nix b/pkgs/by-name/hyprscroller/default.nix new file mode 100644 index 0000000..851275a --- /dev/null +++ b/pkgs/by-name/hyprscroller/default.nix @@ -0,0 +1,59 @@ +{ + lib, + fetchFromGitHub, + hyprland, + pkg-config, + cmake, + unstableGitUpdater, +}: +let + mkHyprlandPlugin = + hyprland: + args@{ pluginName, ... }: + hyprland.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."; + }; + } + ); +in +mkHyprlandPlugin hyprland { + pluginName = "hyprscroller"; + version = "0-unstable-2025-05-16"; + + src = fetchFromGitHub { + owner = "cpiber"; + repo = "hyprscroller"; + rev = "de97924b6d1086d84939b6f6688637f7b21d8d80"; + hash = "sha256-m9689UH+w8Z/qP/DKYtzQfIGfiE4jgBAfO+uH34cfNs="; + }; + + nativeBuildInputs = [ cmake ]; + + installPhase = '' + runHook preInstall + + mkdir -p $out/lib + mv hyprscroller.so $out/lib/libhyprscroller.so + + runHook postInstall + ''; + + passthru.updateScript = unstableGitUpdater { }; + + meta = { + homepage = "https://github.com/cpiber/hyprscroller"; + description = "Hyprland layout plugin providing a scrolling layout like PaperWM"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ youwen5 ]; + platforms = lib.platforms.linux; + }; +} diff --git a/pkgs/default.nix b/pkgs/default.nix index a5e085a..9955d4e 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -4,4 +4,5 @@ let in final: prev: { wine-discord-ipc-bridge = callPackage ./by-name/wine-discord-ipc-bridge { }; + hyprlandPlugins.hyprscroller = callPackage ./by-name/hyprscroller { }; }