Set user environment variables with home-manager

pull/48/head
Simon Bruder 2021-03-11 19:07:32 +01:00
parent a3d1fa50b1
commit b55144906f
Signed by: simon
GPG Key ID: 8D3C82F9F309F8EC
1 changed files with 13 additions and 11 deletions

View File

@ -216,18 +216,19 @@ lib.mkIf nixosConfig.sbruder.gui.enable {
# Cursor
seat seat0 xcursor_theme Adwaita
'';
};
extraSessionCommands = ''
export CLUTTER_BACKEND=wayland
export GDK_BACKEND=wayland
export GDK_DPI_SCALE=1
export MOZ_ENABLE_WAYLAND=1
export QT_QPA_PLATFORM=wayland-egl
export QT_WAYLAND_DISABLE_WINDOWDECORATION=1
export SDL_VIDEODRIVER=wayland
export WLR_NO_HARDWARE_CURSORS=1
export _JAVA_AWT_WM_NONREPARENTING=1
'';
home.sessionVariables = {
CLUTTER_BACKEND = "wayland";
GDK_BACKEND = "wayland";
GDK_DPI_SCALE = 1;
MOZ_ENABLE_WAYLAND = 1;
QT_QPA_PLATFORM = "wayland-egl";
QT_WAYLAND_DISABLE_WINDOWDECORATION = 1;
SDL_VIDEODRIVER = "wayland";
WLR_NO_HARDWARE_CURSORS = 1;
_JAVA_AWT_WM_NONREPARENTING = 1;
_JAVA_OPTIONS = "-Dawt.useSystemAAFontSettings=on";
};
systemd.user.services.swayidle = {
@ -250,6 +251,7 @@ lib.mkIf nixosConfig.sbruder.gui.enable {
programs.zsh.initExtra = ''
if [[ -z $WAYLAND_DISPLAY ]] && [[ $(tty) = /dev/tty1 ]]; then
export XDG_SESSION_TYPE="wayland" # otherwise set to tty
unset __HM_SESS_VARS_SOURCED # otherwise sessionVariables are not updated
exec systemd-cat -t sway sway
fi
'';