From 7c8031f4a8bae413fa56d5c0d1cb9d603291ec3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Silva?= Date: Tue, 24 Oct 2023 14:57:12 +0100 Subject: [PATCH] hyprland: add option for recommended environment variables --- modules/services/window-managers/hyprland.nix | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/modules/services/window-managers/hyprland.nix b/modules/services/window-managers/hyprland.nix index ed41e8d2da85..a0577a0e7e41 100644 --- a/modules/services/window-managers/hyprland.nix +++ b/modules/services/window-managers/hyprland.nix @@ -20,10 +20,6 @@ in { [ "wayland" "windowManager" "hyprland" "disableAutoreload" ] "Autoreloading now always happens") - (lib.mkRemovedOptionModule # \ - [ "wayland" "windowManager" "hyprland" "recommendedEnvironment" ] - "Recommended environment variables are now always set") - (lib.mkRemovedOptionModule # \ [ "wayland" "windowManager" "hyprland" "xwayland" "hidpi" ] "HiDPI patches are deprecated. Refer to https://wiki.hyprland.org/Configuring/XWayland") @@ -110,6 +106,12 @@ in { enableNvidiaPatches = lib.mkEnableOption "patching wlroots for better Nvidia support"; + recommendedEnvironment = lib.mkEnableOption null // { + description = lib.mdDoc '' + Whether to set the recommended environment variables, namely `NIXOS_OZONE_WL`. + ''; + }; + settings = lib.mkOption { type = with lib.types; let @@ -192,6 +194,9 @@ in { home.packages = lib.optional (cfg.package != null) cfg.finalPackage; + home.sessionVariables = + lib.mkIf cfg.recommendedEnvironment { NIXOS_OZONE_WL = "1"; }; + xdg.configFile."hypr/hyprland.conf" = let combinedSettings = cfg.settings // { plugin = let