{ inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; flake-parts.url = "github:hercules-ci/flake-parts"; qtile-src = { url = "github:qtile/qtile"; flake = false; }; pywlroots = { url = "path:pywlroots"; inputs.nixpkgs.follows = "nixpkgs"; }; # smartfloat = { # url = "path:smartfloat"; # inputs.nixpkgs.follows = "nixpkgs"; # }; # scenefx = { # url = "path:scenefx"; # inputs.nixpkgs.follows = "nixpkgs"; # }; }; outputs = inputs @ { flake-parts, qtile-src, pywlroots, ... }: flake-parts.lib.mkFlake {inherit inputs;} { systems = ["x86_64-linux"]; perSystem = { config, self', inputs', pkgs, system, ... }: rec { packages.qtile-unwrapped = with pkgs; with python3Packages; buildPythonPackage rec { pname = "qtile"; version = "unstable-${inputs.qtile-src.lastModifiedDate}"; src = inputs.qtile-src; SETUPTOOLS_SCM_PRETEND_VERSION = "0.23.0"; postPatch = '' substituteInPlace libqtile/pangocffi.py \ --replace libgobject-2.0.so.0 ${pkgs.glib.out}/lib/libgobject-2.0.so.0 \ --replace libpangocairo-1.0.so.0 ${pkgs.pango.out}/lib/libpangocairo-1.0.so.0 \ --replace libpango-1.0.so.0 ${pkgs.pango.out}/lib/libpango-1.0.so.0 substituteInPlace libqtile/backend/x11/xcursors.py \ --replace libxcb-cursor.so.0 ${pkgs.xcb-util-cursor.out}/lib/libxcb-cursor.so.0 substituteInPlace libqtile/backend/wayland/cffi/cairo_buffer.py \ --replace drm_fourcc.h libdrm/drm_fourcc.h substituteInPlace libqtile/backend/wayland/cffi/build.py \ --replace /usr/include/pixman-1 ${lib.getDev pkgs.pixman}/include \ --replace /usr/include/libdrm ${lib.getDev pkgs.libdrm}/include/libdrm ''; nativeBuildInputs = [ pkg-config setuptools-scm setuptools ]; propagatedBuildInputs = [ xcffib (cairocffi.override {withXcffib = true;}) python-dateutil dbus-python dbus-next mpd2 psutil pulsectl-asyncio pyxdg pygobject3 pywayland inputs'.pywlroots.packages.default xkbcommon ]; buildInputs = [ libinput libxkbcommon libdrm wayland xorg.xcbutilwm # inputs'.scenefx.packages.default ((wlroots_0_16.override { xwayland = xwayland; enableXWayland = true; }) .overrideAttrs (wf: wp: { postPatch = wp.postPatch + '' substituteInPlace render/gles2/renderer.c --replace "glFlush();" "glFinish();" ''; })) ]; # patches = [./scenefx.patch]; makeWrapperArgs = [ "--suffix PATH : ${lib.makeBinPath [mypy]}" ]; doCheck = false; }; packages.qtile = with pkgs; with python3Packages; (python3.withPackages (_: [packages.qtile-unwrapped])).overrideAttrs (_: { inherit (packages.qtile-unwrapped) pname version meta; name = with packages.qtile-unwrapped; "${pname}-${version}"; passthru.unwrapped = packages.qtile-unwrapped; }); }; }; }