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
This commit is contained in:
teutat3s 2022-02-03 02:47:00 +01:00
parent 2c9fef6cbd
commit 741c0863ed
Signed by untrusted user: teutat3s
GPG key ID: 4FA1D3FA524F22C1
2 changed files with 7 additions and 0 deletions

View file

@ -26,6 +26,11 @@ in
default = { }; 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 { config = mkIf cfg.enable {

View file

@ -1,6 +1,7 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
let let
psCfg = config.pub-solar; psCfg = config.pub-solar;
wlroots = psCfg.graphical.wayland;
xdg = config.home-manager.users."${psCfg.user.name}".xdg; xdg = config.home-manager.users."${psCfg.user.name}".xdg;
variables = { variables = {
XDG_CONFIG_HOME = xdg.configHome; XDG_CONFIG_HOME = xdg.configHome;
@ -15,6 +16,7 @@ let
ECORE_EVAS_ENGINE = "wayland_egl"; ECORE_EVAS_ENGINE = "wayland_egl";
ELM_ENGINE = "wayland_egl"; ELM_ENGINE = "wayland_egl";
SDL_VIDEODRIVER = "wayland"; SDL_VIDEODRIVER = "wayland";
WLR_RENDERER = if wlroots.software-renderer.enable then "pixman" else "gles2";
EDITOR = "/etc/profiles/per-user/${psCfg.user.name}/bin/nvim"; EDITOR = "/etc/profiles/per-user/${psCfg.user.name}/bin/nvim";
VISUAL = "/etc/profiles/per-user/${psCfg.user.name}/bin/nvim"; VISUAL = "/etc/profiles/per-user/${psCfg.user.name}/bin/nvim";