{ config, lib, ... }:
with lib;
let
  cfg = config.mjallen.desktop.hyprland;
in
{
  config = mkIf cfg.enable {
    home.sessionVariables = {
      BROWSER = "${cfg.defaultApps.browser.pname}";
      CLUTTER_BACKEND = "wayland";
      EDITOR = "${cfg.defaultApps.editor.pname}";
      VISUAL = "${cfg.defaultApps.visual.pname}";
      ICON_THEME = cfg.iconThemeName;
      GTK_CSD = "0";
      GTK_THEME = cfg.gtkThemeName;
      GTK_USE_PORTAL = "1";
      HYPRCURSOR_THEME = config.home.pointerCursor.name;
      HYPRCURSOR_SIZE = config.home.pointerCursor.size;
      MOZ_ENABLE_WAYLAND = "1";
      NIXOS_OZONE_WL = "1";
      NIXOS_XDG_OPEN_USE_PORTAL = "1";
      QT_AUTO_SCREEN_SCALE_FACTOR = "1";
      QT_QPA_PLATFORM = "wayland-egl";
      QT_QPA_PLATFORMTHEME = "gtk3";
      QT_SCALE_FACTOR = "1";
      QT_WAYLAND_DISABLE_WINDOWDECORATION = "1";
      SDL_VIDEODRIVER = "wayland";
      TERMINAL = "${cfg.defaultApps.terminal.pname}";
      XCURSOR_THEME = config.home.pointerCursor.name;
      XCURSOR_SIZE = config.home.pointerCursor.size;
      XDG_CACHE_HOME = "\${HOME}/.cache";
      XDG_CONFIG_HOME = "\${HOME}/.config";
      XDG_CURRENT_DESKTOP = "Hyprland";
      XDG_DATA_HOME = "\${HOME}/.local/share";
      XDG_SESSION_DESKTOP = "Hyprland";
      XDG_SESSION_TYPE = "wayland";
    };
  };
}
