From 741c0863ed51d65ce2c60a660630701706f3b87e Mon Sep 17 00:00:00 2001 From: teutat3s Date: Thu, 3 Feb 2022 02:47:00 +0100 Subject: [PATCH] graphical: make wayland use the software renderer pixman optionally, https://github.com/swaywm/wlroots/blob/master/docs/env_vars.md#wlroots-specific This should help run sway in VMs --- modules/graphical/default.nix | 5 +++++ profiles/base-user/session-variables.nix | 2 ++ 2 files changed, 7 insertions(+) diff --git a/modules/graphical/default.nix b/modules/graphical/default.nix index 15042a22..5da7f4f6 100644 --- a/modules/graphical/default.nix +++ b/modules/graphical/default.nix @@ -26,6 +26,11 @@ in default = { }; }; }; + wayland.software-renderer.enable = mkOption { + type = types.bool; + default = false; + description = "Feature flag enabling wlroots software renderer, useful in VMs"; + }; }; config = mkIf cfg.enable { diff --git a/profiles/base-user/session-variables.nix b/profiles/base-user/session-variables.nix index cc3aa69f..5bbfa8ee 100644 --- a/profiles/base-user/session-variables.nix +++ b/profiles/base-user/session-variables.nix @@ -1,6 +1,7 @@ { config, pkgs, ... }: let psCfg = config.pub-solar; + wlroots = psCfg.graphical.wayland; xdg = config.home-manager.users."${psCfg.user.name}".xdg; variables = { XDG_CONFIG_HOME = xdg.configHome; @@ -15,6 +16,7 @@ let ECORE_EVAS_ENGINE = "wayland_egl"; ELM_ENGINE = "wayland_egl"; SDL_VIDEODRIVER = "wayland"; + WLR_RENDERER = if wlroots.software-renderer.enable then "pixman" else "gles2"; EDITOR = "/etc/profiles/per-user/${psCfg.user.name}/bin/nvim"; VISUAL = "/etc/profiles/per-user/${psCfg.user.name}/bin/nvim";