nix-config/home/hyprland/default.nix

150 lines
4.9 KiB
Nix
Raw Normal View History

2025-03-25 01:59:21 +01:00
{ inputs, pkgs, ...}:
2025-03-25 13:43:15 +01:00
let
package = pkgs.hyprland;
2025-03-25 13:46:53 +01:00
super = "SUPER";
2025-03-25 13:43:15 +01:00
in
2025-03-24 23:01:13 +01:00
{
2025-03-24 23:15:10 +01:00
programs.kitty.enable = true;
2025-03-25 01:59:21 +01:00
wayland.windowManager.hyprland = {
2025-03-25 02:13:48 +01:00
inherit package;
2025-03-25 01:59:21 +01:00
enable = true;
2025-03-25 02:18:28 +01:00
systemd = {
enable = true;
variables = [ "--all" ];
};
2025-03-25 01:59:21 +01:00
plugins = [
2025-03-25 02:13:48 +01:00
#inputs.hyprland-plugins.packages.${pkgs.stdenv.hostPlatform.system}.hyprbars
2025-03-25 01:59:21 +01:00
];
};
2025-03-24 23:15:10 +01:00
home.sessionVariables.NIXOS_OZONE_WL = "1";
2025-03-24 23:01:13 +01:00
2025-03-24 23:15:10 +01:00
wayland.windowManager.hyprland.settings = {
2025-03-25 02:13:48 +01:00
env = [
"NIXOS_OZONE_WL,1"
"MOZ_ENABLE_WAYLAND,1"
"MOZ_WEBRENDER,1"
"_JAVA_AWT_WM_NONREPARENTING,1"
"QT_WAYLAND_DISABLE_WINDOWDECORATION,1"
"QT_QPA_PLATFORM,wayland"
"SDL_VIDEODRIVER,wayland"
"GDK_BACKEND,wayland"
];
2025-03-25 13:25:00 +01:00
monitor = [
"DP-1, 1920x1080@60, 1920x0, 1"
"HDMI-A-2, 1920x1080@60, 0x0, 1"
];
2025-03-25 13:43:15 +01:00
bind = [
2025-03-25 13:46:53 +01:00
"${super}, Q, exec, $terminal"
"${super}, C, killactive, "
"${super}, M, exit, "
"${super}, E, exec, $fileManager"
"${super}, V, togglefloating, "
"${super}, R, exec, $menu"
"${super}, S, exec, $power"
"${super}, P, pseudo, " # dwindle
"${super}, J, togglesplit, "# dwindle
2025-03-25 13:43:15 +01:00
# Move focus with mainMod + arrow keys
2025-03-25 13:46:53 +01:00
"${super}, left, movefocus, l"
"${super}, right, movefocus, r"
"${super}, up, movefocus, u"
"${super}, down, movefocus, d"
2025-03-25 13:43:15 +01:00
# Switch workspaces with mainMod + [0-9]
2025-03-25 13:46:53 +01:00
"${super}, 1, workspace, 1"
"${super}, 2, workspace, 2"
"${super}, 3, workspace, 3"
"${super}, 4, workspace, 4"
"${super}, 5, workspace, 5"
"${super}, 6, workspace, 6"
"${super}, 7, workspace, 7"
"${super}, 8, workspace, 8"
"${super}, 9, workspace, 9"
"${super}, 0, workspace, 10"
2025-03-25 13:43:15 +01:00
# Move active window to a workspace with mainMod + SHIFT + [0-9]
2025-03-25 13:46:53 +01:00
"${super} SHIFT, 1, movetoworkspace, 1"
"${super} SHIFT, 2, movetoworkspace, 2"
"${super} SHIFT, 3, movetoworkspace, 3"
"${super} SHIFT, 4, movetoworkspace, 4"
"${super} SHIFT, 5, movetoworkspace, 5"
"${super} SHIFT, 6, movetoworkspace, 6"
"${super} SHIFT, 7, movetoworkspace, 7"
"${super} SHIFT, 8, movetoworkspace, 8"
"${super} SHIFT, 9, movetoworkspace, 9"
"${super} SHIFT, 0, movetoworkspace, 10"
2025-03-25 13:43:15 +01:00
# Example special workspace (scratchpad)
2025-03-25 13:46:53 +01:00
#"${super}, S, togglespecialworkspace, magic"
"${super} SHIFT, S, movetoworkspace, special:magic"
2025-03-25 13:43:15 +01:00
# Scroll through existing workspaces with mainMod + scroll
2025-03-25 13:46:53 +01:00
"${super}, mouse_down, workspace, e+1"
"${super}, mouse_up, workspace, e-1"
2025-03-25 13:43:15 +01:00
# Screenshot
2025-03-25 13:46:53 +01:00
''${super}, Z, exec, grim -g "$(slurp)" $HOME/Pictures/Screenshots/$(date +'%s_grim.png')''
2025-03-25 13:43:15 +01:00
];
bindl = [
#", XF86AudioMute, exec, amixer set Master toggle
", XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"
", XF86AudioPlay, exec, playerctl play-pause" # the stupid key is called play , but it toggles
", XF86AudioNext, exec, playerctl next"
", XF86AudioPrev, exec, playerctl previous"
];
bindle = [
# Multi Media Control
", XF86AudioRaiseVolume, exec, vol --up"
", XF86AudioLowerVolume, exec, vol --down"
", XF86MonBrightnessUp, exec, bri --up"
", XF86MonBrightnessDown, exec, bri --down"
", XF86Search, exec, $menu"
];
bindm = [
2025-03-25 13:46:53 +01:00
"${super}, mouse:272, movewindow"
"${super}, mouse:273, resizewindow"
2025-03-25 13:43:15 +01:00
];
2025-03-24 23:15:10 +01:00
};
2025-03-25 02:18:28 +01:00
# NOTE: this executable is used by greetd to start a wayland session when system boot up
# with such a vendor-no-locking script, we can switch to another wayland compositor without modifying greetd's config in NixOS module
home.file.".wayland-session" = {
source = "${package}/bin/Hyprland";
executable = true;
};
# hyprland configs, based on https://github.com/notwidow/hyprland
/*xdg.configFile = {
"hypr/mako" = {
source = ../conf/mako;
recursive = true;
};
"hypr/scripts" = {
source = ../conf/scripts;
recursive = true;
};
"hypr/waybar" = {
source = ../conf/waybar;
recursive = true;
};
"hypr/wlogout" = {
source = ../conf/wlogout;
recursive = true;
};
# music player - mpd
"mpd" = {
source = ../conf/mpd;
recursive = true;
};
};*/
2025-03-24 12:11:44 +01:00
}