Skip to content

Commit 74d776e

Browse files
aster-voidclaude
andcommitted
refactor: migrate Hyprland config from stow to Nix
- Add home-manager/global/hyprland/ with Nix DSL configs - default.nix: main settings + monitor options per host - binds.nix: keybindings - windowrules.nix: window rules and layer rules - exec.nix: startup commands - hyprlock.nix: lock screen config - hyprpaper.nix: wallpaper daemon - hypridle.nix: idle daemon (moved from services/) - Add my.hyprland options for host-specific settings - primaryMonitor, scale, sensitivity, touchpadScrollFactor - Configure per-host monitor settings in home-manager/default.nix - Remove hyprpaper/hypridle from glue/services (now using HM modules) - Delete stow/.config/hypr/ and stow/.config/uwsm/env-hyprland 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 2774e68 commit 74d776e

37 files changed

+411
-849
lines changed

home-manager/default.nix

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,18 @@
3939
glue.type = "glassy";
4040
# caelestia.enable = true;
4141
};
42+
43+
defaultHyprConf = {
44+
primaryMonitor = "eDP-1";
45+
sensitivity = "0.3";
46+
touchpadScrollFactor = "0.15";
47+
};
4248
in {
4349
"aster@amberwood" = mkConfiguration {
4450
config = {
4551
my.shell = shellConf;
4652
my.extensions.gaming.enable = true;
53+
my.hyprland = defaultHyprConf // {primaryMonitor = "DP-1";};
4754
};
4855
};
4956
"aster@amberwood-wsl" = mkConfiguration {
@@ -55,11 +62,13 @@ in {
5562
config = {
5663
my.shell = shellConf;
5764
my.extensions.gaming.enable = true;
65+
my.hyprland = defaultHyprConf;
5866
};
5967
};
6068
"aster@carbon" = mkConfiguration {
6169
config = {
6270
my.shell = shellConf;
71+
my.hyprland = defaultHyprConf;
6372
};
6473
};
6574
"aster@carbon-wsl" = mkConfiguration {
@@ -71,6 +80,7 @@ in {
7180
config = {
7281
my.shell = shellConf;
7382
my.extensions.gaming.enable = true;
83+
my.hyprland = defaultHyprConf;
7484
};
7585
};
7686
}

home-manager/global/default.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@
1010
./i18n
1111
./secrets
1212
./shell
13+
./hyprland
1314
];
1415
}
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
_: let
2+
term = "kitty";
3+
mainMod = "SUPER";
4+
in {
5+
wayland.windowManager.hyprland.settings = {
6+
"$mainMod" = mainMod;
7+
"$TERM" = term;
8+
9+
bind = [
10+
# System commands
11+
"${mainMod}, L, exec, hyprlock"
12+
13+
# App launching + closing
14+
"${mainMod}, N, exec, ${term}"
15+
"${mainMod}, E, killactive"
16+
"${mainMod}, O, exec, fuzzel"
17+
"${mainMod}, K, exec, rofi -show"
18+
"${mainMod}, I, exec, caelestia shell drawers toggle launcher"
19+
"${mainMod}, delete, exec, systemctl --user stop graphical-session.target && hyprctl dispatch exit"
20+
"${mainMod}, F, togglefloating"
21+
"${mainMod} SHIFT, F, fullscreen"
22+
"${mainMod}, J, togglesplit"
23+
24+
# Screenshots
25+
"${mainMod}, P, exec, hyprshot -m region"
26+
"${mainMod} SHIFT, P, exec, hyprshot -m output"
27+
"${mainMod} CTRL, P, exec, hyprshot -m window"
28+
29+
# Brightness
30+
"${mainMod}, f4, exec, brightnessctl s 10%-"
31+
"${mainMod}, f5, exec, brightnessctl s +10%"
32+
33+
# Move focus (WASD in workman = DASH)
34+
"${mainMod}, D, movefocus, u"
35+
"${mainMod}, A, movefocus, l"
36+
"${mainMod}, S, movefocus, d"
37+
"${mainMod}, H, movefocus, r"
38+
39+
# Move windows
40+
"${mainMod} SHIFT, D, movewindow, u"
41+
"${mainMod} SHIFT, A, movewindow, l"
42+
"${mainMod} SHIFT, S, movewindow, d"
43+
"${mainMod} SHIFT, H, movewindow, r"
44+
45+
# Switch workspaces
46+
"${mainMod}, 1, workspace, 1"
47+
"${mainMod}, 2, workspace, 2"
48+
"${mainMod}, 3, workspace, 3"
49+
"${mainMod}, 4, workspace, 4"
50+
"${mainMod}, 5, workspace, 5"
51+
"${mainMod}, 6, workspace, 6"
52+
"${mainMod}, 7, workspace, 7"
53+
"${mainMod}, 8, workspace, 8"
54+
"${mainMod}, 9, workspace, 9"
55+
"${mainMod}, 0, workspace, 10"
56+
57+
# Swipe between workspaces
58+
"${mainMod}, left, workspace, r-1"
59+
"${mainMod}, right, workspace, r+1"
60+
61+
# Move to workspace
62+
"${mainMod} SHIFT, 1, movetoworkspace, 1"
63+
"${mainMod} SHIFT, 2, movetoworkspace, 2"
64+
"${mainMod} SHIFT, 3, movetoworkspace, 3"
65+
"${mainMod} SHIFT, 4, movetoworkspace, 4"
66+
"${mainMod} SHIFT, 5, movetoworkspace, 5"
67+
"${mainMod} SHIFT, 6, movetoworkspace, 6"
68+
"${mainMod} SHIFT, 7, movetoworkspace, 7"
69+
"${mainMod} SHIFT, 8, movetoworkspace, 8"
70+
"${mainMod} SHIFT, 9, movetoworkspace, 9"
71+
"${mainMod} SHIFT, 0, movetoworkspace, 10"
72+
73+
# Special workspace (scratchpad)
74+
"${mainMod}, M, togglespecialworkspace, magic"
75+
"${mainMod} SHIFT, M, movetoworkspace, special:magic"
76+
77+
# Scroll through workspaces
78+
"${mainMod}, mouse_down, workspace, e-1"
79+
"${mainMod}, mouse_up, workspace, e+1"
80+
81+
# Middle mouse button (no-op)
82+
",mouse:274, exec, ;"
83+
];
84+
85+
# Move/resize with mouse
86+
bindm = [
87+
"${mainMod}, mouse:272, movewindow"
88+
"${mainMod}, mouse:273, resizewindow"
89+
];
90+
91+
# Non-consuming bind (passes key to other apps too)
92+
bindn = [
93+
", escape, exec, eww close power-menu"
94+
];
95+
};
96+
}
Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
{
2+
config,
3+
lib,
4+
...
5+
}: let
6+
cfg = config.my.hyprland;
7+
in {
8+
imports = [
9+
./binds.nix
10+
./windowrules.nix
11+
./exec.nix
12+
./hyprlock.nix
13+
./hyprpaper.nix
14+
./hypridle.nix
15+
];
16+
17+
options.my.hyprland = {
18+
primaryMonitor = lib.mkOption {
19+
type = lib.types.str;
20+
default = "";
21+
description = "Primary monitor name (e.g., eDP-1, DP-1)";
22+
};
23+
scale = lib.mkOption {
24+
type = lib.types.str;
25+
default = "1.0";
26+
description = "Monitor scale factor";
27+
};
28+
sensitivity = lib.mkOption {
29+
type = lib.types.str;
30+
default = "0";
31+
description = "Mouse sensitivity";
32+
};
33+
touchpadScrollFactor = lib.mkOption {
34+
type = lib.types.str;
35+
default = "1.0";
36+
description = "Touchpad scroll factor";
37+
};
38+
};
39+
40+
config = {
41+
wayland.windowManager.hyprland = {
42+
enable = true;
43+
package = null; # Use NixOS module's package
44+
systemd = {
45+
enable = true;
46+
enableXdgAutostart = true;
47+
};
48+
xwayland.enable = true;
49+
50+
settings = {
51+
# Monitor configuration
52+
monitor =
53+
if cfg.primaryMonitor != ""
54+
then ["${cfg.primaryMonitor},preferred,0x0,${cfg.scale}" ",preferred,auto,1"]
55+
else [",preferred,auto,1"];
56+
57+
misc = {
58+
vrr = 1;
59+
disable_hyprland_logo = true;
60+
force_default_wallpaper = 2;
61+
focus_on_activate = true;
62+
};
63+
64+
input = {
65+
kb_layout = "us";
66+
kb_variant = "workman";
67+
kb_options = "caps:escape";
68+
repeat_rate = 40;
69+
repeat_delay = 250;
70+
follow_mouse = 1;
71+
mouse_refocus = false;
72+
inherit (cfg) sensitivity;
73+
accel_profile = "flat";
74+
75+
touchpad = {
76+
natural_scroll = true;
77+
disable_while_typing = true;
78+
scroll_factor = cfg.touchpadScrollFactor;
79+
};
80+
};
81+
82+
general = {
83+
gaps_in = 0;
84+
gaps_out = 0;
85+
border_size = 0;
86+
"col.active_border" = "rgb(303030)";
87+
"col.inactive_border" = "rgba(303030aa)";
88+
layout = "dwindle";
89+
allow_tearing = true;
90+
};
91+
92+
xwayland.force_zero_scaling = true;
93+
94+
decoration = {
95+
rounding = 0;
96+
blur = {
97+
enabled = true;
98+
size = 8;
99+
passes = 3;
100+
ignore_opacity = false;
101+
new_optimizations = true;
102+
xray = false;
103+
};
104+
};
105+
106+
animations = {
107+
enabled = true;
108+
bezier = ["myBezier, 0.05, 0.9, 0.1, 1.05"];
109+
animation = [
110+
"windows, 1, 2, myBezier"
111+
"windowsOut, 1, 2, default, popin 80%"
112+
"border, 1, 2, default"
113+
"borderangle, 1, 2, default"
114+
"fade, 1, 2, default"
115+
"workspaces, 1, 1, default"
116+
];
117+
};
118+
119+
dwindle = {
120+
pseudotile = true;
121+
preserve_split = true;
122+
};
123+
124+
gestures = {
125+
workspace_swipe_distance = 300;
126+
workspace_swipe_invert = true;
127+
workspace_swipe_forever = false;
128+
workspace_swipe_create_new = true;
129+
};
130+
131+
cursor.no_hardware_cursors = false;
132+
};
133+
};
134+
};
135+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
_: {
2+
wayland.windowManager.hyprland.settings = {
3+
exec-once = [
4+
# Environment variables for portals/tray/notifications
5+
"dbus-update-activation-environment --systemd --all"
6+
"systemctl --user import-environment WAYLAND_DISPLAY XDG_SESSION_TYPE XDG_CURRENT_DESKTOP XDG_SESSION_DESKTOP"
7+
"systemctl --user start graphical-session.target xdg-desktop-autostart.target"
8+
9+
# Launch apps on startup
10+
"[workspace 1 silent] kitty"
11+
"[workspace 2 silent] zen-beta"
12+
"[workspace 3 silent] discord"
13+
"[workspace 4 silent] slack"
14+
"hyprctl dispatch workspace 1"
15+
16+
# IME
17+
"systemctl --user restart fcitx5-daemon"
18+
];
19+
};
20+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{
1+
_: {
22
services.hypridle = {
33
enable = true;
44
settings = {

0 commit comments

Comments
 (0)