Redid hyprscrolling.nix
This commit is contained in:
+20
-17
@@ -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
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user