From 5a8ee96cbcd4c0f9569d29699af6511ddaf4d6b2 Mon Sep 17 00:00:00 2001 From: Adam0 Date: Wed, 15 Jul 2026 21:50:35 -0400 Subject: [PATCH] Split plugins module away from hyprland --- .../{plugins.nix => plugins/hyprfocus.nix} | 55 ++++--------------- .../desktop/hyprland/plugins/hyprsplit.nix | 13 +++++ modules/desktop/hyprland/plugins/kinetic.nix | 55 +++++++++++++++++++ modules/desktop/hyprland/rules.nix | 15 ----- modules/hosts/laptop/home.nix | 3 + modules/profiles/personal.nix | 6 ++ 6 files changed, 87 insertions(+), 60 deletions(-) rename modules/desktop/hyprland/{plugins.nix => plugins/hyprfocus.nix} (53%) create mode 100644 modules/desktop/hyprland/plugins/hyprsplit.nix create mode 100644 modules/desktop/hyprland/plugins/kinetic.nix diff --git a/modules/desktop/hyprland/plugins.nix b/modules/desktop/hyprland/plugins/hyprfocus.nix similarity index 53% rename from modules/desktop/hyprland/plugins.nix rename to modules/desktop/hyprland/plugins/hyprfocus.nix index f22dcf0..57e8888 100644 --- a/modules/desktop/hyprland/plugins.nix +++ b/modules/desktop/hyprland/plugins/hyprfocus.nix @@ -6,58 +6,23 @@ }; }; - flake.modules.homeManager.hyprland = { - # keep-sorted start + flake.modules.homeManager.hyprlandHyprfocusPlugin = { lib, pkgs, - # keep-sorted end ... }: let - inherit - (lib) - # keep-sorted start - concatMapStringsSep - mkOrder - # keep-sorted end - ; - - kineticScroll = pkgs.nur.repos.adam0.hyprlandPlugins.hypr-kinetic-scroll; - kineticScrollDisabledClasses = [ - # keep-sorted start - "Beeper" - "Bitwarden" - "com.github.tchx84.Flatseal" - "equibop" - "gimp" - "io.github.dp0sk.Crosspipe" - "org.bleachbit.BleachBit" - "org.gnome.Decibels" - "org.gnome.Loupe" - "org.gnome.Showtime" - "org.gnome.seahorse.Application" - "org.pwmt.zathura" - "proton.vpn.app.gtk" - "steam" - "zen-beta" - # keep-sorted end - ]; - kineticScrollDisableRules = concatMapStringsSep "\n" (class: " hl.plugin.kinetic_scroll.disable(\"${class}\")") kineticScrollDisabledClasses; + hyprfocus = pkgs.hyprlandPlugins.hyprfocus; in { - wayland.windowManager.hyprland.plugins = [ - # keep-sorted start - kineticScroll - pkgs.hyprlandPlugins.hyprfocus - # keep-sorted end - ]; + wayland.windowManager.hyprland.plugins = [hyprfocus]; programs.hylix = { - _generatedConfig = mkOrder 899 '' - -- Expose hyprsplit for keybind dispatchers. - hyprsplit = dofile("${pkgs.nur.repos.adam0.hyprsplit}/init.lua") - hyprsplit.config({ num_workspaces = 8 }) - - ${kineticScrollDisableRules} - ''; + permissions = [ + { + binary = lib.escapeRegex "${hyprfocus}/lib/libhyprfocus.so"; + mode = "allow"; + type = "plugin"; + } + ]; settings.plugin.hyprfocus = { # keep-sorted start diff --git a/modules/desktop/hyprland/plugins/hyprsplit.nix b/modules/desktop/hyprland/plugins/hyprsplit.nix new file mode 100644 index 0000000..6bc9591 --- /dev/null +++ b/modules/desktop/hyprland/plugins/hyprsplit.nix @@ -0,0 +1,13 @@ +{ + flake.modules.homeManager.hyprlandHyprsplitPlugin = { + lib, + pkgs, + ... + }: { + programs.hylix._generatedConfig = lib.mkOrder 899 '' + -- Expose hyprsplit for keybind dispatchers. + hyprsplit = dofile("${pkgs.nur.repos.adam0.hyprsplit}/init.lua") + hyprsplit.config({ num_workspaces = 8 }) + ''; + }; +} diff --git a/modules/desktop/hyprland/plugins/kinetic.nix b/modules/desktop/hyprland/plugins/kinetic.nix new file mode 100644 index 0000000..96311eb --- /dev/null +++ b/modules/desktop/hyprland/plugins/kinetic.nix @@ -0,0 +1,55 @@ +{ + flake.modules.homeManager.HyprlandKineticPlugin = { + # keep-sorted start + lib, + pkgs, + # keep-sorted end + ... + }: let + inherit + (lib) + # keep-sorted start + concatMapStringsSep + escapeRegex + mkOrder + # keep-sorted end + ; + + kineticScroll = pkgs.nur.repos.adam0.hyprlandPlugins.hypr-kinetic-scroll; + + kineticScrollDisabledClasses = [ + # keep-sorted start + "Beeper" + "Bitwarden" + "com.github.tchx84.Flatseal" + "equibop" + "gimp" + "io.github.dp0sk.Crosspipe" + "org.bleachbit.BleachBit" + "org.gnome.Decibels" + "org.gnome.Loupe" + "org.gnome.Showtime" + "org.gnome.seahorse.Application" + "org.pwmt.zathura" + "proton.vpn.app.gtk" + "steam" + "zen-beta" + # keep-sorted end + ]; + kineticScrollDisableRules = concatMapStringsSep "\n" (class: " hl.plugin.kinetic_scroll.disable(\"${class}\")") kineticScrollDisabledClasses; + in { + wayland.windowManager.hyprland.plugins = [kineticScroll]; + + programs.hylix = { + _generatedConfig = mkOrder 899 kineticScrollDisableRules; + + permissions = [ + { + binary = escapeRegex "${kineticScroll}/lib/libhypr-kinetic-scroll.so"; + mode = "allow"; + type = "plugin"; + } + ]; + }; + }; +} diff --git a/modules/desktop/hyprland/rules.nix b/modules/desktop/hyprland/rules.nix index 731d47f..892a238 100644 --- a/modules/desktop/hyprland/rules.nix +++ b/modules/desktop/hyprland/rules.nix @@ -23,7 +23,6 @@ grim = getExe pkgs.grim; hyprctl = getExe' osConfig.programs.hyprland.package "hyprctl"; hyprpicker = getExe pkgs.hyprpicker; - kineticScroll = "${pkgs.nur.repos.adam0.hyprlandPlugins.hypr-kinetic-scroll}/lib/libhypr-kinetic-scroll.so"; noctalia-qs = getExe' inputs.noctalia-qs.packages.${pkgs.stdenv.hostPlatform.system}.quickshell ".quickshell-wrapped"; overzicht = getExe' config.programs.quickshell.package ".quickshell-wrapped"; xdg-desktop-portal-hyprland = getExe' osConfig.programs.hyprland.portalPackage ".xdg-desktop-portal-hyprland-wrapped"; @@ -32,26 +31,12 @@ programs.hylix = { permissions = [ # Plugins - # keep-sorted start block=yes newline_separated=yes - { - binary = ".*/libhyprfocus\\.so$"; - mode = "allow"; - type = "plugin"; - } - { binary = escapeRegex hyprctl; mode = "allow"; type = "plugin"; } - { - binary = escapeRegex kineticScroll; - mode = "allow"; - type = "plugin"; - } - # keep-sorted end - # Screencopy # keep-sorted start block=yes newline_separated=yes { diff --git a/modules/hosts/laptop/home.nix b/modules/hosts/laptop/home.nix index e5165f0..4cb3b69 100644 --- a/modules/hosts/laptop/home.nix +++ b/modules/hosts/laptop/home.nix @@ -16,6 +16,9 @@ personal # keep-sorted end + # Hyprland plugins + HyprlandKineticPlugin + # TUI # keep-sorted start bluetui diff --git a/modules/profiles/personal.nix b/modules/profiles/personal.nix index 06c6030..e02b33b 100644 --- a/modules/profiles/personal.nix +++ b/modules/profiles/personal.nix @@ -77,6 +77,12 @@ xdgTerminal # keep-sorted end + # Hyprland plugins + # keep-sorted start + hyprlandHyprfocusPlugin + hyprlandHyprsplitPlugin + # keep-sorted end + # Programs gtk -- 2.51.2