system/modules/home-manager/configs/window-manager/hyprland.nix

132 lines
2.8 KiB
Nix

{ config, pkgs, lib, ... }:
let
cfg = config.local.window-manager.hyprland;
in
{
options.local.window-manager.hyprland = with lib; {
enable = mkEnableOption "hyperland window manager";
};
config = lib.mkIf cfg.enable {
home.packages = with pkgs.unstable; [
foot
wl-clipboard
wlsunset
swaybg
dmenu-wayland
];
wayland.windowManager.hyprland = {
enable = true;
package = pkgs.unstable.hyprland;
systemd.enable = true;
xwayland.enable = true;
settings = {
# monitors
monitor = ",preferred,auto,auto";
# env
env = [
"XCURSOR_SIZE,24"
"HYPRCURSOR_SIZE,24"
];
# look and feel
general = {
gaps_in = 5;
gaps_out = 20;
border_size = 2;
"col.active_border" = "rgba(33ccffee) rgba(00ff99ee) 45deg";
"col.inactive_border" = "rgba(595959aa)";
resize_on_border = false;
allow_tearing = false;
layout = "master";
};
decoration = {
rounding = 5;
active_opacity = 1.0;
inactive_opacity = 1.0;
drop_shadow = false;
blur = {
enabled = false;
};
};
animations = {
enabled = false;
};
master = {
orientation = "top";
new_is_master = false;
};
gestures = {
workspace_swipe = false;
};
"$terminal" = "foot";
"$browser" = "librewolf";
"$fileManager" = "vifm";
"$menu" = "dmenu-wl_run";
"$mod" = "ALT_L";
bind = lib.flatten [
# programs
"$mod SHIFT, Return, exec, $terminal"
"$mod SHIFT, S, exec, flameshot gui"
"$mod SHIFT, B, exec, $browser"
"$mod, p, exec, $menu"
# Move focus
(lib.flip lib.mapAttrsToList { L = "r"; H = "l"; J = "d"; K = "u"; } (k: d:
"$mod, ${k}, movefocus, ${d}"
))
(lib.flip map [ 1 2 3 4 5 6 7 8 9 0 ] (i:
let wid = if i == 0 then 10 else i; in
[
# switch warkspaces with mod + [0-9]
"$mod, ${toString i}, workspace, ${toString wid}"
# move active window to a workspace with mod + shift + [0-9]
"$mod SHIFT, ${toString i}, movetoworkspace, ${toString wid}"
]
))
];
bindm = [
"$mod, mouse:272, movewindow"
"$mod, mouse:273, resizewindow"
];
input = let kb = config.home.keyboard; in {
kb_model = kb.model;
kb_layout = kb.layout;
kb_variant = kb.variant;
kb_options = lib.head kb.options;
};
};
};
};
}