diff --git a/henrovnix_ok/assets/conf/dev/terminal/aliases.conf b/henrovnix_ok/assets/conf/dev/terminal/aliases.conf index 4ba74cd2f..3989c58f8 100644 --- a/henrovnix_ok/assets/conf/dev/terminal/aliases.conf +++ b/henrovnix_ok/assets/conf/dev/terminal/aliases.conf @@ -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' diff --git a/henrovnix_ok/home/desktop/hyprscrolling.nix b/henrovnix_ok/home/desktop/hyprscrolling.nix index a6b98ce4a..4aab8892d 100644 --- a/henrovnix_ok/home/desktop/hyprscrolling.nix +++ b/henrovnix_ok/home/desktop/hyprscrolling.nix @@ -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