From 7141eb9c5790417da38ce5ea5b273cd1aa994307 Mon Sep 17 00:00:00 2001 From: Yureka Date: Mon, 11 Oct 2021 21:41:06 +0200 Subject: [PATCH] sway: make xwayland optional --- pkgs/applications/window-managers/sway/default.nix | 9 +++++++-- pkgs/applications/window-managers/sway/wrapper.nix | 4 +++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/window-managers/sway/default.nix b/pkgs/applications/window-managers/sway/default.nix index 92de633f0fa8..fb0cb31fad57 100644 --- a/pkgs/applications/window-managers/sway/default.nix +++ b/pkgs/applications/window-managers/sway/default.nix @@ -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; diff --git a/pkgs/applications/window-managers/sway/wrapper.nix b/pkgs/applications/window-managers/sway/wrapper.nix index 07459295d759..7bcb26e0c972 100644 --- a/pkgs/applications/window-managers/sway/wrapper.nix +++ b/pkgs/applications/window-managers/sway/wrapper.nix @@ -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