Compare commits
4 Commits
1e2cd6e66a
...
9acfe4b630
| Author | SHA1 | Date | |
|---|---|---|---|
| 9acfe4b630 | |||
| 4c6a2fd8e3 | |||
| 8d841cfcd0 | |||
| 5e2585efa0 |
+15
-43
@@ -1764,56 +1764,28 @@ 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;
|
||||
defaultPluginPkg = (pkgs.hyprlandPlugins.hyprscrolling or null);
|
||||
# Stable paths (avoid pinning /nix/store/... in your hyprland.conf)
|
||||
stableSoPath = "/etc/hypr/plugins/libhyprscrolling.so";
|
||||
dropInConfPath = "/etc/hypr/conf.d/90-hyprscrolling.conf";
|
||||
# Read drop-in config from your repo (flake root)
|
||||
dropInConfSourcePath = flakeRoot + "/assets/conf/desktop/hypr/hyprscrolling.conf";
|
||||
dropInConf = builtins.readFile dropInConfSourcePath;
|
||||
repoConf = flakeRoot + "/assets/conf/desktop/hypr/hyprscrolling.conf";
|
||||
targetRel = "hypr/conf.d/90-hyprscrolling.conf";
|
||||
in
|
||||
{
|
||||
options.programs.hyprscrolling = {
|
||||
enable = lib.mkEnableOption "Hyprland hyprscrolling (scrolling layout) plugin (NixOS-friendly)";
|
||||
pluginPackage = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.package;
|
||||
default = defaultPluginPkg;
|
||||
description = ''
|
||||
Package that provides the hyprscrolling plugin.
|
||||
Defaults to pkgs.hyprlandPlugins.hyprscrolling when available.
|
||||
'';
|
||||
};
|
||||
# Where we install the generated config snippet (so you can `source = ...` it)
|
||||
dropInPath = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = dropInConfPath;
|
||||
description = "Path to the Hyprland drop-in config file (needs to be sourced by your hyprland.conf).";
|
||||
};
|
||||
# Where we install a stable symlink to the plugin .so
|
||||
stablePluginSoPath = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = stableSoPath;
|
||||
description = "Stable path for the plugin shared object (symlinked to the Nix store).";
|
||||
};
|
||||
};
|
||||
options.programs.hyprscrolling.enable =
|
||||
lib.mkEnableOption "hyprscrolling Hyprland plugin";
|
||||
config = lib.mkIf cfg.enable {
|
||||
assertions = [
|
||||
{
|
||||
assertion = cfg.pluginPackage != null;
|
||||
message = ''
|
||||
Could not find hyprscrolling plugin package in this nixpkgs.
|
||||
Set programs.hyprscrolling.pluginPackage explicitly (e.g. pkgs.hyprlandPlugins.hyprscrolling).
|
||||
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}
|
||||
'';
|
||||
}
|
||||
];
|
||||
environment.systemPackages = [ cfg.pluginPackage ];
|
||||
environment.etc."hypr/plugins/libhyprscrolling.so".source =
|
||||
"${cfg.pluginPackage}/lib/libhyprscrolling.so";
|
||||
# Now /etc/hypr/conf.d/90-hyprscrolling.conf is exactly your file’s contents
|
||||
environment.etc."hypr/conf.d/90-hyprscrolling.conf".text = dropInConf;
|
||||
};
|
||||
# place your repo config into ~/.config/hypr/conf.d/...
|
||||
xdg.configFile."${targetRel}".source = repoConf;
|
||||
};
|
||||
}
|
||||
#+end_src
|
||||
|
||||
@@ -28,8 +28,6 @@ wofi
|
||||
xdg-utils
|
||||
desktop-file-utils
|
||||
playerctl
|
||||
rofi
|
||||
simple-scan
|
||||
mpv
|
||||
|
||||
#productivity
|
||||
|
||||
@@ -45,8 +45,8 @@ bind = $mainMod SHIFT, R, exec, hyprctl reload
|
||||
|
||||
# Switch windows
|
||||
bind = $mainMod, TAB, hyprexpo:expo, toggle
|
||||
bind = ALT, TAB, exec, wofi --show window
|
||||
bind = ALT SHIFT, TAB, cyclenext , prev
|
||||
bind = ALT, TAB, cyclenext
|
||||
bind = ALT, SHIFT, TAB, cyclenext prev
|
||||
|
||||
# Hyprscrolling
|
||||
bind = $mainMod, period, layoutmsg, move +col
|
||||
|
||||
@@ -21,7 +21,7 @@ alias gcp='git add . && git commit && git push'
|
||||
alias cd='z'
|
||||
|
||||
alias nps='xdg-open https://search.nixos.org'
|
||||
alias hvnx='cd ~/Repos/nixos/henrovnix'
|
||||
alias hvnx='cd ~/Repos/nixos/henrovnix_ok'
|
||||
alias emt='hvnx && emacs README.org --batch -f org-babel-tangle && emacs -Q --batch README.org -f org-html-export-to-html'
|
||||
alias nxs='hvnx && sudo nixos-rebuild switch --flake .#traveldroid'
|
||||
alias nxt='hvnx && sudo nixos-rebuild test --flake .#traveldroid'
|
||||
|
||||
@@ -1,62 +1,52 @@
|
||||
# --------------------------------------------------
|
||||
# Hyprscrolling – scrolling layout with indicators
|
||||
# Managed in repo: assets/conf/desktop/hypr/hyprscrolling.conf
|
||||
# --------------------------------------------------
|
||||
|
||||
# Load plugin (.so is symlinked by Nix module)
|
||||
plugin = /etc/hypr/plugins/libhyprscrolling.so
|
||||
|
||||
# Make scrolling the default layout
|
||||
general {
|
||||
layout = scrolling
|
||||
{ config, lib, pkgs, flakeRoot, ... }:
|
||||
let
|
||||
cfg = config.programs.hyprscrolling;
|
||||
defaultPluginPkg = (pkgs.hyprlandPlugins.hyprscrolling or null);
|
||||
# Stable paths (avoid pinning /nix/store/... in your hyprland.conf)
|
||||
stableSoPath = "/etc/hypr/plugins/libhyprscrolling.so";
|
||||
dropInConfPath = "/etc/hypr/conf.d/90-hyprscrolling.conf";
|
||||
# Read drop-in config from your repo (flake root)
|
||||
dropInConfSourcePath = flakeRoot + "/assets/conf/desktop/hypr/hyprscrolling.conf";
|
||||
dropInConf = builtins.readFile dropInConfSourcePath;
|
||||
in
|
||||
{
|
||||
options.programs.hyprscrolling = {
|
||||
enable = lib.mkEnableOption "Hyprland hyprscrolling (scrolling layout) plugin (NixOS-friendly)";
|
||||
pluginPackage = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.package;
|
||||
default = defaultPluginPkg;
|
||||
description = ''
|
||||
Package that provides the hyprscrolling plugin.
|
||||
Defaults to pkgs.hyprlandPlugins.hyprscrolling when available.
|
||||
'';
|
||||
};
|
||||
# Where we install the generated config snippet (so you can `source = ...` it)
|
||||
dropInPath = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = dropInConfPath;
|
||||
description = "Path to the Hyprland drop-in config file (needs to be sourced by your hyprland.conf).";
|
||||
};
|
||||
# Where we install a stable symlink to the plugin .so
|
||||
stablePluginSoPath = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = stableSoPath;
|
||||
description = "Stable path for the plugin shared object (symlinked to the Nix store).";
|
||||
};
|
||||
};
|
||||
config = lib.mkIf cfg.enable {
|
||||
assertions = [
|
||||
{
|
||||
assertion = cfg.pluginPackage != null;
|
||||
message = ''
|
||||
Could not find hyprscrolling plugin package in this nixpkgs.
|
||||
Set programs.hyprscrolling.pluginPackage explicitly (e.g. pkgs.hyprlandPlugins.hyprscrolling).
|
||||
'';
|
||||
}
|
||||
];
|
||||
environment.systemPackages = [ cfg.pluginPackage ];
|
||||
environment.etc."hypr/plugins/libhyprscrolling.so".source =
|
||||
"${cfg.pluginPackage}/lib/libhyprscrolling.so";
|
||||
# Now /etc/hypr/conf.d/90-hyprscrolling.conf is exactly your file’s contents
|
||||
environment.etc."hypr/conf.d/90-hyprscrolling.conf".text = dropInConf;
|
||||
};
|
||||
}
|
||||
|
||||
# --------------------------------------------------
|
||||
# Plugin configuration
|
||||
# --------------------------------------------------
|
||||
|
||||
plugin:hyprscrolling {
|
||||
|
||||
# --- Core behaviour ---
|
||||
enable = true
|
||||
focus_follows_mouse = true
|
||||
smooth_scrolling = true
|
||||
|
||||
# --- Gaps & spacing ---
|
||||
gaps_in = 6
|
||||
gaps_out = 16
|
||||
|
||||
# --- Indicators ---
|
||||
# Show visual indicators for stacked windows
|
||||
indicators = true
|
||||
|
||||
# Style of indicators (examples: line, dots, bar)
|
||||
indicator_style = bar
|
||||
|
||||
# Thickness / size
|
||||
indicator_thickness = 4
|
||||
|
||||
# Spacing between indicators
|
||||
indicator_spacing = 6
|
||||
|
||||
# Offset from window edge
|
||||
indicator_offset = 8
|
||||
|
||||
# Colors (RGBA)
|
||||
indicator_color_active = rgba(137, 180, 250, 0.9) # blue-ish (Catppuccin style)
|
||||
indicator_color_inactive = rgba(88, 91, 112, 0.6)
|
||||
|
||||
# Position (top, bottom, left, right)
|
||||
indicator_position = bottom
|
||||
}
|
||||
|
||||
# --------------------------------------------------
|
||||
# Optional keybinds
|
||||
# --------------------------------------------------
|
||||
|
||||
# Scroll through stack
|
||||
bind = SUPER, mouse_down, layoutmsg, scroll +1
|
||||
bind = SUPER, mouse_up, layoutmsg, scroll -1
|
||||
|
||||
# Toggle layout manually
|
||||
bind = SUPER, S, layoutmsg, togglesplit
|
||||
|
||||
Reference in New Issue
Block a user