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";