sway: make xwayland optional

This commit is contained in:
Yureka 2021-10-11 21:41:06 +02:00 committed by Yuka
parent ab63bfb36b
commit 7141eb9c57
2 changed files with 10 additions and 3 deletions

View File

@ -6,6 +6,8 @@
, nixosTests
# Used by the NixOS module:
, isNixOS ? false
, enableXWayland ? true
}:
stdenv.mkDerivation rec {
@ -40,13 +42,16 @@ stdenv.mkDerivation rec {
buildInputs = [
wayland libxkbcommon pcre json_c dbus libevdev
pango cairo libinput libcap pam gdk-pixbuf librsvg
wlroots wayland-protocols libdrm
wayland-protocols libdrm
(wlroots.override { inherit enableXWayland; })
];
mesonFlags = [
"-Ddefault-wallpaper=false"
"-Dsd-bus-provider=libsystemd"
];
]
++ lib.optional (!enableXWayland) "-Dxwayland=disabled"
;
passthru.tests.basic = nixosTests.sway;

View File

@ -6,6 +6,8 @@
, extraOptions ? [] # E.g.: [ "--verbose" ]
# Used by the NixOS module:
, isNixOS ? false
, enableXWayland ? true
}:
assert extraSessionCommands != "" -> withBaseWrapper;
@ -13,7 +15,7 @@ assert extraSessionCommands != "" -> withBaseWrapper;
with lib;
let
sway = sway-unwrapped.override { inherit isNixOS; };
sway = sway-unwrapped.override { inherit isNixOS enableXWayland; };
baseWrapper = writeShellScriptBin "sway" ''
set -o errexit
if [ ! "$_SWAY_WRAPPER_ALREADY_EXECUTED" ]; then