1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-18 11:40:45 +00:00

nixos/hyprland: Set environment variables for Hyprland to work better

XDG vars set to Hyprland
GTK and QT backend set to wayland (preferred), with x11 as fallback
Java AWT fix for tiling window managers
This commit is contained in:
John Titor 2024-04-27 11:44:44 +05:30
parent bf93cd2c56
commit d18a587b78
No known key found for this signature in database
GPG key ID: 29B0514F4E3C1CC0

View file

@ -42,6 +42,15 @@ in
xwayland.enable = mkEnableOption ("XWayland") // { default = true; };
envVars.enable = mkEnableOption null // {
default = true;
example = false;
description = ''
Set environment variables for Hyprland to work properly.
Enabled by default.
'';
};
systemd.setPath.enable = mkEnableOption null // {
default = true;
example = false;
@ -74,6 +83,15 @@ in
configPackages = mkDefault [ cfg.finalPackage ];
};
environment.sessionVariables = mkIf cfg.envVars.enable {
XDG_CURRENT_DESKTOP = "Hyprland";
XDG_SESSION_DESKTOP = "Hyprland";
XDG_SESSION_TYPE = "wayland";
GDK_BACKEND = "wayland,x11";
QT_QPA_PLATFORM = "wayland;xcb";
_JAVA_AWT_WM_NONREPARENTING = "1"; # Fix for Java applications on tiling window managers
};
systemd = mkIf cfg.systemd.setPath.enable {
user.extraConfig = ''
DefaultEnvironment="PATH=$PATH:/run/current-system/sw/bin:/etc/profiles/per-user/%u/bin:/run/wrappers/bin"