From b55144906f3e5cd6561f0ce360c0d94cf981dd91 Mon Sep 17 00:00:00 2001 From: Simon Bruder Date: Thu, 11 Mar 2021 19:07:32 +0100 Subject: [PATCH] Set user environment variables with home-manager --- users/simon/modules/sway.nix | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/users/simon/modules/sway.nix b/users/simon/modules/sway.nix index 20ed170..71feea3 100644 --- a/users/simon/modules/sway.nix +++ b/users/simon/modules/sway.nix @@ -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 '';