summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMihai Fufezan <fufexan@protonmail.com>2022-09-07 00:45:24 +0300
committerMihai Fufezan <fufexan@pm.me>2022-09-07 01:24:09 +0300
commit1d631c8a233257738a08b3e5aebc8df22d3253fe (patch)
tree180d5dddfa481a0942e3b9264c1fcb22ac929066
parent789eedd115917bc0ae7e5ee7317af67295439fd8 (diff)
Nix modules: add common environment variables
-rw-r--r--nix/hm-module.nix12
-rw-r--r--nix/module.nix31
2 files changed, 36 insertions, 7 deletions
diff --git a/nix/hm-module.nix b/nix/hm-module.nix
index 0f4e8a3b..be678ba4 100644
--- a/nix/hm-module.nix
+++ b/nix/hm-module.nix
@@ -81,6 +81,18 @@ in {
lib.optional (cfg.package != null) cfg.package
++ lib.optional cfg.xwayland.enable pkgs.xwayland;
+ home.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 toString config.home.pointerCursor.size or "24";
+ XDG_SESSION_TYPE = lib.mkDefault "wayland";
+ };
+
xdg.configFile."hypr/hyprland.conf" = {
text =
(lib.optionalString cfg.systemdIntegration ''
diff --git a/nix/module.nix b/nix/module.nix
index 9969d0eb..31ecdbdc 100644
--- a/nix/module.nix
+++ b/nix/module.nix
@@ -33,14 +33,31 @@ in {
};
config = mkIf cfg.enable {
- environment.systemPackages = lib.optional (cfg.package != null) cfg.package;
- security.polkit.enable = true;
- hardware.opengl.enable = mkDefault true;
+ 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";
+ };
+ };
fonts.enableDefaultFonts = mkDefault true;
- programs.dconf.enable = mkDefault true;
+ hardware.opengl.enable = mkDefault true;
+ programs = {
+ dconf.enable = mkDefault true;
+ xwayland.enable = mkDefault true;
+ };
+ security.polkit.enable = true;
services.xserver.displayManager.sessionPackages = lib.optional (cfg.package != null) cfg.package;
- programs.xwayland.enable = mkDefault true;
- xdg.portal.enable = mkDefault true;
- xdg.portal.extraPortals = [pkgs.xdg-desktop-portal-wlr];
+ xdg.portal = {
+ enable = mkDefault true;
+ portal.extraPortals = [pkgs.xdg-desktop-portal-wlr];
+ };
};
}