Redid hyprscrolling.nix

This commit is contained in:
2026-02-25 19:48:57 +01:00
parent 706fdf6470
commit a72f387de0
2 changed files with 40 additions and 34 deletions
+20 -17
View File
@@ -1764,29 +1764,32 @@ in
** hyprscrolling
This Nix module integrates the hyprscrolling plugin into a Home-Manager managed Hyprland setup in a declarative and reproducible way. It ensures the plugin is installed, optionally switches Hyprland to the scrolling layout, and renders user-defined plugin settings directly into the Hyprland configuration. The goal is to manage the scrolling workspace behavior entirely from Nix instead of maintaining manual edits inside hyprland.conf.
#+begin_src nix :tangle home/desktop/hyprscrolling.nix :noweb tangle :mkdirp yes
# home/desktop/hyprscrolling.nix (Home-Manager module)
# home/desktop/hyprscrolling.nix (Home-Manager module)
{ config, lib, pkgs, flakeRoot, ... }:
let
cfg = config.programs.hyprscrolling;
repoConf = flakeRoot + "/assets/conf/desktop/hypr/hyprscrolling.conf";
repoConf =
flakeRoot + "/assets/conf/desktop/hypr/hyprscrolling.conf";
targetRel = "hypr/conf.d/90-hyprscrolling.conf";
in
{
options.programs.hyprscrolling.enable =
lib.mkEnableOption "hyprscrolling Hyprland plugin";
config = lib.mkIf cfg.enable {
wayland.windowManager.hyprland = {
# the key part: load plugin like you did for hyprshell
plugins = [ pkgs.hyprlandPlugins.hyprscrolling ];
# source the generated drop-in
extraConfig = lib.mkAfter ''
source = ~/.config/${targetRel}
'';
};
# place your repo config into ~/.config/hypr/conf.d/...
xdg.configFile."${targetRel}".source = repoConf;
# Make sure Hyprland is managed by Home-Manager
wayland.windowManager.hyprland = {
enable = true;
# Load the plugin
plugins = [
pkgs.hyprlandPlugins.hyprscrolling
];
# Source the drop-in config
extraConfig = ''
source = ~/.config/${targetRel}
'';
};
# Copy your repo config into ~/.config
xdg.configFile."${targetRel}".source = repoConf;
}
#+end_src
+20 -17
View File
@@ -1,24 +1,27 @@
# home/desktop/hyprscrolling.nix (Home-Manager module)
# home/desktop/hyprscrolling.nix (Home-Manager module)
{ config, lib, pkgs, flakeRoot, ... }:
let
cfg = config.programs.hyprscrolling;
repoConf = flakeRoot + "/assets/conf/desktop/hypr/hyprscrolling.conf";
repoConf =
flakeRoot + "/assets/conf/desktop/hypr/hyprscrolling.conf";
targetRel = "hypr/conf.d/90-hyprscrolling.conf";
in
{
options.programs.hyprscrolling.enable =
lib.mkEnableOption "hyprscrolling Hyprland plugin";
config = lib.mkIf cfg.enable {
wayland.windowManager.hyprland = {
# the key part: load plugin like you did for hyprshell
plugins = [ pkgs.hyprlandPlugins.hyprscrolling ];
# source the generated drop-in
extraConfig = lib.mkAfter ''
source = ~/.config/${targetRel}
'';
};
# place your repo config into ~/.config/hypr/conf.d/...
xdg.configFile."${targetRel}".source = repoConf;
# Make sure Hyprland is managed by Home-Manager
wayland.windowManager.hyprland = {
enable = true;
# Load the plugin
plugins = [
pkgs.hyprlandPlugins.hyprscrolling
];
# Source the drop-in config
extraConfig = ''
source = ~/.config/${targetRel}
'';
};
# Copy your repo config into ~/.config
xdg.configFile."${targetRel}".source = repoConf;
}