Files
dotfiles/nixos/hyprland.nix
Ivan Malison cf8892152c feat: add hyprscratch scratchpad management with rule reapply fork
- Add hyprscratch from colonelpanic8/reapply-rules-on-toggle fork that
  reapplies size/position/float rules on every toggle (not just spawn)
- Configure 9 scratchpads: htop, volume, spotify, element, slack,
  transmission, dropdown, gmail, messages
- Use clean mode (hide on workspace change) and auto-dismiss (only
  dropdown persists)
- Fix pavucontrol class (org.pulseaudio.pavucontrol) and dropdown
  position (offset by taffybar height)
- Add kanshi-sni, dbus-menu, dbus-hslogger flake inputs and follows

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-18 19:05:35 -07:00

106 lines
3.0 KiB
Nix

{ config, pkgs, makeEnable, inputs, ... }:
makeEnable config "myModules.hyprland" true {
myModules.taffybar.enable = true;
programs.hyprland = {
enable = true;
# Use Hyprland from the flake for proper plugin compatibility
package = inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.hyprland;
# Let UWSM manage the Hyprland session targets
withUWSM = true;
};
home-manager.sharedModules = [
inputs.hyprscratch.homeModules.default
{
services.kanshi = {
enable = true;
systemdTarget = "hyprland-session.target";
};
programs.hyprscratch = {
enable = true;
settings = {
daemon_options = "clean";
global_options = "";
global_rules = "float;size monitor_w*0.95 monitor_h*0.95;center";
htop = {
command = "alacritty --class htop-scratch --title htop -e htop";
class = "htop-scratch";
};
volume = {
command = "pavucontrol";
class = "org.pulseaudio.pavucontrol";
};
spotify = {
command = "spotify";
class = "spotify";
};
element = {
command = "element-desktop";
class = "Element";
};
slack = {
command = "slack";
class = "Slack";
};
transmission = {
command = "transmission-gtk";
class = "transmission-gtk";
};
dropdown = {
command = "ghostty --config-file=/home/imalison/.config/ghostty/dropdown";
class = "com.mitchellh.ghostty.dropdown";
options = "persist";
rules = "float;size monitor_w monitor_h*0.5;move 0 60;noborder;noshadow;animation slide";
};
gmail = {
command = "google-chrome-stable --new-window https://mail.google.com/mail/u/0/#inbox";
class = "google-chrome";
title = "Gmail";
};
messages = {
command = "google-chrome-stable --new-window https://messages.google.com/web/conversations";
class = "google-chrome";
title = "Messages";
};
};
};
}
];
# Hyprland-specific packages
environment.systemPackages = with pkgs; [
# Hyprland utilities
hyprpaper # Wallpaper
hypridle # Idle daemon
hyprlock # Screen locker
hyprcursor # Cursor themes
wl-clipboard # Clipboard for Wayland
wtype # Wayland input typing
cliphist # Clipboard history
grim # Screenshot utility
slurp # Region selection
swappy # Screenshot annotation
nwg-displays # GUI monitor arrangement
# hy3 plugin from flake (properly built against matching Hyprland)
inputs.hy3.packages.${pkgs.stdenv.hostPlatform.system}.hy3
# Hyprexpo plugin from hyprland-plugins (workspace overview)
inputs.hyprland-plugins.packages.${pkgs.stdenv.hostPlatform.system}.hyprexpo
# For scripts
jq
];
}