{ stdenv, lib, fetchFromGitHub, makeWrapper , meson, ninja , pkgconfig, scdoc , wayland, libxkbcommon, pcre, json_c, libevdev, pango, cairo, libinput , wlroots, wayland-protocols, swaybg , gdkPixbufSupport ? true, gdk-pixbuf , xwaylandSupport ? lib.elem "-Dxwayland=enabled" wlroots.mesonFlags }: stdenv.mkDerivation rec { pname = "sway"; version = "1.2"; src = fetchFromGitHub { owner = "swaywm"; repo = "sway"; rev = version; sha256 = "0vch2zm5afc76ia78p3vg71zr2fyda67l9hd2h0x1jq3mnvfbxnd"; }; patches = [ ./sway-config-no-nix-store-references.patch ./load-configuration-from-etc.patch ]; nativeBuildInputs = [ pkgconfig meson ninja scdoc makeWrapper ]; buildInputs = [ wayland libxkbcommon pcre json_c libevdev pango cairo libinput wlroots wayland-protocols ] ++ lib.optional gdkPixbufSupport gdk-pixbuf; enableParallelBuilding = true; mesonFlags = [ "-Ddefault-wallpaper=false" "-Dtray=enabled" "-Dman-pages=enabled" ] ++ lib.optional gdkPixbufSupport "-Dgdk-pixbuf=enabled" ++ lib.optional xwaylandSupport "-Dxwayland=enabled"; postInstall = '' wrapProgram $out/bin/sway --prefix PATH : "${swaybg}/bin" ''; meta = with lib; { description = "i3-compatible tiling Wayland compositor"; homepage = https://swaywm.org; license = licenses.mit; platforms = platforms.linux; maintainers = with maintainers; [ primeos synthetica ]; }; }