diff options
Diffstat (limited to '')
-rw-r--r-- | modules/hyprland.nix | 131 |
1 files changed, 131 insertions, 0 deletions
diff --git a/modules/hyprland.nix b/modules/hyprland.nix new file mode 100644 index 0000000..c7f574a --- /dev/null +++ b/modules/hyprland.nix @@ -0,0 +1,131 @@ +{ + config, + lib, + ... +}: +let + cfg = config.nixfiles.modules.hyprland; +in +{ + options.nixfiles.modules.hyprland.enable = lib.mkEnableOption "Hyprland"; + + config = lib.mkIf cfg.enable { + nixfiles.modules.wayland.enable = true; + + hm = { + stylix.targets.hyprland.enable = false; + + wayland.windowManager.hyprland = { + enable = true; + + systemd = { + enable = true; + variables = [ "--all" ]; + }; + + settings = { + misc = { + disable_hyprland_logo = true; + disable_splash_rendering = true; + }; + + general = { + gaps_in = 0; + gaps_out = 0; + }; + + decoration = { + blur.enabled = false; + }; + + animations.enabled = false; + + debug.disable_logs = false; + + input = with config.services.xserver.xkb; { + kb_layout = layout; + kb_variant = variant; + kb_options = options; + + repeat_delay = config.services.xserver.autoRepeatDelay; + repeat_rate = config.services.xserver.autoRepeatInterval; + }; + + bindm = [ + "SUPER, mouse:272, movewindow" + "SUPER, mouse:273, resizewindow" + "SUPER ALT, mouse:272, resizewindow" + ]; + + bind = + [ + "SUPER SHIFT, E, exec, pkill Hyprland" + + "SUPER, D, killactive," + "SUPER, F, fullscreen," + + "SUPER, G, togglegroup," + "SUPER SHIFT, N, changegroupactive, f" + "SUPER SHIFT, P, changegroupactive, b" + + "SUPER, R, togglesplit," + "SUPER, T, togglefloating," + "SUPER, P, pseudo," + "SUPER ALT, ,resizeactive," + + "SUPER, Return, exec, foot" + "SUPER, L, exec, pgrep hyprlock || hyprlock" + + "SUPER, H, movefocus, l" + "SUPER, J, movefocus, d" + "SUPER, K, movefocus, u" + "SUPER, L, movefocus, r" + + "SUPER SHIFT, H, movewindow, l" + "SUPER SHIFT, J, movewindow, d" + "SUPER SHIFT, K, movewindow, u" + "SUPER SHIFT, L, movewindow, r" + + "SUPER ALT, H, resizeactive, 10 0" + "SUPER ALT, J, resizeactive, 0 10" + "SUPER ALT, K, resizeactive, 0 -10" + "SUPER ALT, L, resizeactive, -10 0" + + ", XF86AudioPlay, exec, mpc play" + ", XF86AudioPrev, exec, mpc prev" + ", XF86AudioNext, exec, mpc next" + + ", XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ .1+" + ", XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ .1-" + + ", XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle" + ", XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle" + + ", XF86MonBrightnessUp, exec, brightnessctl set +5%" + ", XF86MonBrightnessDown, exec, brightnessctl set 5%-" + ] + ++ (builtins.concatLists ( + builtins.genList ( + x: + let + ws = + let + c = (x + 1) / 10; + in + toString (x + 1 - (c * 10)); + in + [ + "SUPER, ${ws}, workspace, ${toString (x + 1)}" + "SUPER SHIFT, ${ws}, movetoworkspace, ${toString (x + 1)}" + ] + ) 10 + )); + }; + }; + + programs.hyprlock.enable = true; + }; + + programs.hyprland.enable = true; + }; +} |