Redid hyprscrolling.nix
This commit is contained in:
+20
-17
@@ -1764,29 +1764,32 @@ in
|
|||||||
** hyprscrolling
|
** 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.
|
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
|
#+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, ... }:
|
{ config, lib, pkgs, flakeRoot, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.programs.hyprscrolling;
|
repoConf =
|
||||||
repoConf = flakeRoot + "/assets/conf/desktop/hypr/hyprscrolling.conf";
|
flakeRoot + "/assets/conf/desktop/hypr/hyprscrolling.conf";
|
||||||
|
|
||||||
targetRel = "hypr/conf.d/90-hyprscrolling.conf";
|
targetRel = "hypr/conf.d/90-hyprscrolling.conf";
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.programs.hyprscrolling.enable =
|
# Make sure Hyprland is managed by Home-Manager
|
||||||
lib.mkEnableOption "hyprscrolling Hyprland plugin";
|
wayland.windowManager.hyprland = {
|
||||||
config = lib.mkIf cfg.enable {
|
enable = true;
|
||||||
wayland.windowManager.hyprland = {
|
|
||||||
# the key part: load plugin like you did for hyprshell
|
# Load the plugin
|
||||||
plugins = [ pkgs.hyprlandPlugins.hyprscrolling ];
|
plugins = [
|
||||||
# source the generated drop-in
|
pkgs.hyprlandPlugins.hyprscrolling
|
||||||
extraConfig = lib.mkAfter ''
|
];
|
||||||
source = ~/.config/${targetRel}
|
|
||||||
'';
|
# Source the drop-in config
|
||||||
};
|
extraConfig = ''
|
||||||
# place your repo config into ~/.config/hypr/conf.d/...
|
source = ~/.config/${targetRel}
|
||||||
xdg.configFile."${targetRel}".source = repoConf;
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Copy your repo config into ~/.config
|
||||||
|
xdg.configFile."${targetRel}".source = repoConf;
|
||||||
}
|
}
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
|||||||
@@ -1,24 +1,27 @@
|
|||||||
# home/desktop/hyprscrolling.nix (Home-Manager module)
|
|
||||||
# home/desktop/hyprscrolling.nix (Home-Manager module)
|
|
||||||
{ config, lib, pkgs, flakeRoot, ... }:
|
{ config, lib, pkgs, flakeRoot, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.programs.hyprscrolling;
|
repoConf =
|
||||||
repoConf = flakeRoot + "/assets/conf/desktop/hypr/hyprscrolling.conf";
|
flakeRoot + "/assets/conf/desktop/hypr/hyprscrolling.conf";
|
||||||
|
|
||||||
targetRel = "hypr/conf.d/90-hyprscrolling.conf";
|
targetRel = "hypr/conf.d/90-hyprscrolling.conf";
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.programs.hyprscrolling.enable =
|
# Make sure Hyprland is managed by Home-Manager
|
||||||
lib.mkEnableOption "hyprscrolling Hyprland plugin";
|
wayland.windowManager.hyprland = {
|
||||||
config = lib.mkIf cfg.enable {
|
enable = true;
|
||||||
wayland.windowManager.hyprland = {
|
|
||||||
# the key part: load plugin like you did for hyprshell
|
# Load the plugin
|
||||||
plugins = [ pkgs.hyprlandPlugins.hyprscrolling ];
|
plugins = [
|
||||||
# source the generated drop-in
|
pkgs.hyprlandPlugins.hyprscrolling
|
||||||
extraConfig = lib.mkAfter ''
|
];
|
||||||
source = ~/.config/${targetRel}
|
|
||||||
'';
|
# Source the drop-in config
|
||||||
};
|
extraConfig = ''
|
||||||
# place your repo config into ~/.config/hypr/conf.d/...
|
source = ~/.config/${targetRel}
|
||||||
xdg.configFile."${targetRel}".source = repoConf;
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Copy your repo config into ~/.config
|
||||||
|
xdg.configFile."${targetRel}".source = repoConf;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user