nixos-config/modules/desktop/hyprland/default.nix
2023-09-14 23:00:03 -04:00

61 lines
1.3 KiB
Nix

{ config, lib, pkgs, system, inputs, ... }:
let
exec = "exec Hyprland";
in
{
imports = [ ../../programs/waybar.nix ];
environment = {
loginShellInit = ''
if [ -z $DISPLAY ] && [ "$(tty)" = "/dev/tty1" ]; then
${exec}
fi
''; # Will automatically open Hyprland when logged into tty1
variables = {
#WLR_NO_HARDWARE_CURSORS="1"; # Possible variables needed in vm
#WLR_RENDERER_ALLOW_SOFTWARE="1";
XDG_CURRENT_DESKTOP = "Hyprland";
XDG_SESSION_TYPE = "wayland";
XDG_SESSION_DESKTOP = "Hyprland";
XCURSOR_SIZE = "108";
};
sessionVariables = {
QT_QPA_PLATFORM = "wayland";
QT_WAYLAND_DISABLE_WINDOWDECORATION = "1";
GDK_BACKEND = "wayland";
WLR_NO_HARDWARE_CURSORS = "1";
MOZ_ENABLE_WAYLAND = "1";
};
systemPackages = with pkgs; [
grim
mpvpaper
slurp
swappy
swaylock
wl-clipboard
wlr-randr
];
};
security.pam.services.swaylock = {
text = ''
auth include login
'';
};
programs = {
hyprland = {
enable = true;
package = inputs.hyprland.packages.${pkgs.system}.hyprland;
};
};
xdg.portal = {
# Required for flatpak with window managers and for file browsing
enable = true;
extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
};
}