NixOS/environments/hyprland.nix
2025-09-28 17:16:43 -06:00

111 lines
3.0 KiB
Nix

{
inputs,
pkgs,
...
}:
let
startupScript = pkgs.pkgs.writeShellScriptBin "start" ''
${pkgs.waybar}/bin/waybar &
${pkgs.swww}/bin/swww init &
sleep 1
'';
in
{
programs.hyprland.enable = true;
services.greetd = {
enable = true;
settings.default_session = {
command = "${pkgs.greetd.tuigreet}/bin/tuigreet --time --cmd Hyprland";
user = "greeter";
};
};
xdg.portal = {
enable = true;
extraPortals = [
pkgs.xdg-desktop-portal-hyprland
pkgs.xdg-desktop-portal-gtk
];
};
users.users.jawz.packages = builtins.attrValues {
inherit (pkgs)
# Wayland utilities
wl-clipboard
wf-recorder
grim
slurp
wofi # Application launcher
mako # Notification daemon
libnotify # dependency of mako
swaylock-effects # Screen locker
nautilus # File manager
;
};
home-manager.users.jawz = {
programs.kitty.enable = true;
wayland.windowManager.hyprland = {
enable = true;
settings = {
"$mainMod" = "SUPER";
exec-once = "${startupScript}/bin/start";
general = {
gaps_in = 5;
gaps_out = 10;
border_size = 2;
layout = "dwindle";
};
dwindle = {
pseudotile = true;
preserve_split = true;
force_split = 2;
};
bind = [
"$mainMod, return, exec, kitty"
"$mainMod, Q, killactive,"
"$mainMod SHIFT, F, togglefloating,"
"$mainMod, F, fullscreen,"
"$mainMod, T, pin,"
"$mainMod, G, togglegroup,"
"$mainMod, bracketleft, changegroupactive, b"
"$mainMod, bracketright, changegroupactive, f"
"$mainMod, S, exec, wofi --show drun icons"
"$mainMod, P, pin, active"
",XF86AudioRaiseVolume, exec, wpctl set-volume -l 1.4 @DEFAULT_AUDIO_SINK@ 5%+"
",XF86AudioLowerVolume, exec, wpctl set-volume -l 1.4 @DEFAULT_AUDIO_SINK@ 5%-"
"$mainMod, left, movefocus, l"
"$mainMod, right, movefocus, r"
"$mainMod, up, movefocus, u"
"$mainMod, down, movefocus, d"
"$mainMod, h, movefocus, l"
"$mainMod, l, movefocus, r"
"$mainMod, k, movefocus, u"
"$mainMod, j, movefocus, d"
"$mainMod SHIFT, h, movewindow, l"
"$mainMod SHIFT, l, movewindow, r"
"$mainMod SHIFT, k, movewindow, u"
"$mainMod SHIFT, j, movewindow, d"
];
binde = [
"$mainMod SHIFT, h, moveactive, -20 0"
"$mainMod SHIFT, l, moveactive, 20 0"
"$mainMod SHIFT, k, moveactive, 0 -20"
"$mainMod SHIFT, j, moveactive, 0 20"
"$mainMod CTRL, l, resizeactive, 30 0"
"$mainMod CTRL, h, resizeactive, -30 0"
"$mainMod CTRL, k, resizeactive, 0 -10"
"$mainMod CTRL, j, resizeactive, 0 10"
];
bindm = [
"$mainMod, mouse:272, movewindow"
"$mainMod, mouse:273, resizewindow"
];
};
};
};
}