sway: make xwayland optional

Yureka 7141eb9c ab63bfb3

+10 -3
+7 -2
pkgs/applications/window-managers/sway/default.nix
··· 6 6 , nixosTests 7 7 # Used by the NixOS module: 8 8 , isNixOS ? false 9 + 10 + , enableXWayland ? true 9 11 }: 10 12 11 13 stdenv.mkDerivation rec { ··· 40 42 buildInputs = [ 41 43 wayland libxkbcommon pcre json_c dbus libevdev 42 44 pango cairo libinput libcap pam gdk-pixbuf librsvg 43 - wlroots wayland-protocols libdrm 45 + wayland-protocols libdrm 46 + (wlroots.override { inherit enableXWayland; }) 44 47 ]; 45 48 46 49 mesonFlags = [ 47 50 "-Ddefault-wallpaper=false" 48 51 "-Dsd-bus-provider=libsystemd" 49 - ]; 52 + ] 53 + ++ lib.optional (!enableXWayland) "-Dxwayland=disabled" 54 + ; 50 55 51 56 passthru.tests.basic = nixosTests.sway; 52 57
+3 -1
pkgs/applications/window-managers/sway/wrapper.nix
··· 6 6 , extraOptions ? [] # E.g.: [ "--verbose" ] 7 7 # Used by the NixOS module: 8 8 , isNixOS ? false 9 + 10 + , enableXWayland ? true 9 11 }: 10 12 11 13 assert extraSessionCommands != "" -> withBaseWrapper; ··· 13 15 with lib; 14 16 15 17 let 16 - sway = sway-unwrapped.override { inherit isNixOS; }; 18 + sway = sway-unwrapped.override { inherit isNixOS enableXWayland; }; 17 19 baseWrapper = writeShellScriptBin "sway" '' 18 20 set -o errexit 19 21 if [ ! "$_SWAY_WRAPPER_ALREADY_EXECUTED" ]; then