From f0db46ffda50a8d07f4e80b13fb3f9b8e30dead3 Mon Sep 17 00:00:00 2001 From: Ayman Boukraa Date: Wed, 4 Mar 2026 17:19:52 +0100 Subject: [PATCH] feat: env module with wayland vars, correct editor fallbacks --- home/modules/env.nix | 31 +++++++++++++++++++++++++++++++ home/modules/zsh.nix | 14 -------------- 2 files changed, 31 insertions(+), 14 deletions(-) create mode 100644 home/modules/env.nix diff --git a/home/modules/env.nix b/home/modules/env.nix new file mode 100644 index 0000000..91d3316 --- /dev/null +++ b/home/modules/env.nix @@ -0,0 +1,31 @@ +{ ... }: + +{ + home.sessionPath = [ + "$HOME/.local/bin" + "$HOME/.config/emacs/bin" + ]; + + systemd.user.sessionVariables = { + # Terminal + TERMINAL = "kitty"; + + # Wayland + ELECTRON_OZONE_PLATFORM_HINT = "auto"; + NIXOS_OZONE_WL = "1"; + MOZ_ENABLE_WAYLAND = "1"; + QT_QPA_PLATFORM = "wayland"; + GDK_BACKEND = "wayland"; + SDL_VIDEODRIVER = "wayland"; + _JAVA_AWT_WM_NONREPARENTING = "1"; + + # Editor + EDITOR = "emacsclient -c -a nvim"; + VISUAL = "emacsclient -c -a nvim"; + SUDO_EDITOR = "nvim"; + + # Pager + PAGER = "bat --color auto"; + MANPAGER = "bat -plman"; + }; +} diff --git a/home/modules/zsh.nix b/home/modules/zsh.nix index 8fd8ae3..186259a 100644 --- a/home/modules/zsh.nix +++ b/home/modules/zsh.nix @@ -33,18 +33,4 @@ in }; }; - # PATH additions — HM prepends these to PATH in the correct order - home.sessionPath = [ - "$HOME/.config/emacs/bin" - ]; - - # Environment variables - home.sessionVariables = { - EDITOR = "emacsclient -c"; - VISUAL = "emacsclient -c"; - SUDO_EDITOR = "emacsclient -c"; - PAGER = "bat --color auto"; - MANPAGER = "bat -plman"; - _JAVA_AWT_WM_NONREPARENTING = "1"; - }; }