51 lines
1.8 KiB
Nix
51 lines
1.8 KiB
Nix
{ config, lib, pkgs, flakeRoot,...}:
|
|
let
|
|
# Hyprscrolling drop-in config (repo -> ~/.config)
|
|
repoConf = flakeRoot + "/assets/conf/desktop/hypr/hyprscrolling.conf";
|
|
targetRel = "hypr/conf.d/90-hyprscrolling.conf";
|
|
# Overflow indicator script (repo -> ~/.config)
|
|
repoOverflowScript = flakeRoot + "/assets/conf/desktop/hypr/scripts/hyprscroll-overflow.sh";
|
|
targetOverflowRel = "hypr/scripts/hyprscroll-overflow.sh";
|
|
# Adapt columnsize to monitor
|
|
repoPerMonitorScript = flakeRoot + "/assets/conf/desktop/hypr/scripts/hyprscrolling-per-monitor.sh";
|
|
targetPerMonitor = "hypr/scripts/hyprscrolling-per-monitor.sh";
|
|
# Facilitate switching between scrolling and dwindle
|
|
repoSwitchScript =
|
|
flakeRoot + "/assets/conf/desktop/hypr/scripts/toggle-layout-scrolling-dwindle.sh";
|
|
targetSwitchScript = "hypr/scripts/toggle-layout-scrolling-dwindle.sh";
|
|
in
|
|
{
|
|
# Ensure deps for the script exist at runtime
|
|
# (hyprctl comes with Hyprland; jq is often not installed by default)
|
|
home.packages = with pkgs; [
|
|
jq
|
|
];
|
|
wayland.windowManager.hyprland = {
|
|
enable = true;
|
|
plugins = [
|
|
pkgs.hyprlandPlugins.hyprscrolling
|
|
];
|
|
extraConfig = ''
|
|
source = ~/.config/${targetRel}
|
|
'';
|
|
};
|
|
# Copy repo configs/scripts into ~/.config
|
|
xdg.configFile."${targetRel}".source = lib.mkForce repoConf;
|
|
xdg.configFile."${targetRel}".backup = lib.mkForce false;
|
|
xdg.configFile."${targetOverflowRel}" = {
|
|
source = lib.mkForce repoOverflowScript;
|
|
backup = lib.mkForce false;
|
|
executable = true; # makes it chmod +x
|
|
};
|
|
xdg.configFile."${targetPerMonitor}" = {
|
|
source = lib.mkForce repoPerMonitorScript;
|
|
backup = lib.mkForce false;
|
|
executable = true; # makes it chmod +x
|
|
};
|
|
xdg.configFile."${targetSwitchScript}" = {
|
|
source = lib.mkForce repoSwitchScript;
|
|
backup = lib.mkForce false;
|
|
executable = true; # makes it chmod +x
|
|
};
|
|
}
|