diff options
| author | Mihai Fufezan <fufexan@protonmail.com> | 2022-09-09 15:40:30 +0300 |
|---|---|---|
| committer | Mihai Fufezan <fufexan@pm.me> | 2022-09-09 17:01:24 +0300 |
| commit | 9370c7aa8a0f43b4471626f95013e1bf55539c19 (patch) | |
| tree | 833685aaf54e752a577cf5e0eb91759b2e6f3919 /nix/module.nix | |
| parent | 928158bbfb906bd871738d60610d85634d1f8c7e (diff) | |
Nix modules: add recommendedEnvironment option
Diffstat (limited to 'nix/module.nix')
| -rw-r--r-- | nix/module.nix | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/nix/module.nix b/nix/module.nix index 2dc8659a..395a020b 100644 --- a/nix/module.nix +++ b/nix/module.nix @@ -30,21 +30,28 @@ in { Hyprland package to use. ''; }; + + recommendedEnvironment = mkOption { + type = types.bool; + default = true; + defaultText = literalExpression "true"; + example = literalExpression "false"; + description = '' + Whether to set the recommended environment variables. + ''; + }; }; config = mkIf cfg.enable { environment = { systemPackages = lib.optional (cfg.package != null) cfg.package; - sessionVariables = { - CLUTTER_BACKEND = lib.mkDefault "wayland"; - GDK_BACKEND = lib.mkDefault "wayland"; - _JAVA_AWT_WM_NONREPARENTING = lib.mkDefault "1"; - MOZ_ENABLE_WAYLAND = lib.mkDefault "1"; - NIXOS_OZONE_WL = lib.mkDefault "1"; - QT_QPA_PLATFORM = lib.mkDefault "wayland;xcb"; - QT_WAYLAND_DISABLE_WINDOWDECORATION = lib.mkDefault "1"; - XCURSOR_SIZE = lib.mkDefault "24"; - XDG_SESSION_TYPE = lib.mkDefault "wayland"; + + sessionVariables = mkIf cfg.recommendedEnvironment { + GDK_BACKEND = "wayland"; + _JAVA_AWT_WM_NONREPARENTING = "1"; + NIXOS_OZONE_WL = "1"; + XCURSOR_SIZE = "24"; + XDG_SESSION_TYPE = "wayland"; }; }; fonts.enableDefaultFonts = mkDefault true; |
