1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, cairocffi
5, dbus-next
6, dbus-python
7, glib
8, libinput
9, libxkbcommon
10, mpd2
11, pango
12, pkg-config
13, psutil
14, pulseaudio
15, pygobject3
16, python-dateutil
17, pywayland
18, pywlroots
19, pyxdg
20, setuptools
21, setuptools-scm
22, wayland
23, wlroots
24, xcbutilcursor
25, xcffib
26, xkbcommon
27}:
28
29buildPythonPackage rec {
30 pname = "qtile";
31 version = "0.22.1";
32
33 src = fetchFromGitHub {
34 owner = "qtile";
35 repo = "qtile";
36 rev = "v${version}";
37 hash = "sha256-HOyExVKOqZ4OeNM1/AiXQeiUV+EbSJLEjWEibm07ff8=";
38 };
39
40 patches = [
41 ./fix-restart.patch # https://github.com/NixOS/nixpkgs/issues/139568
42 ];
43
44 postPatch = ''
45 substituteInPlace libqtile/pangocffi.py \
46 --replace libgobject-2.0.so.0 ${glib.out}/lib/libgobject-2.0.so.0 \
47 --replace libpangocairo-1.0.so.0 ${pango.out}/lib/libpangocairo-1.0.so.0 \
48 --replace libpango-1.0.so.0 ${pango.out}/lib/libpango-1.0.so.0
49 substituteInPlace libqtile/backend/x11/xcursors.py \
50 --replace libxcb-cursor.so.0 ${xcbutilcursor.out}/lib/libxcb-cursor.so.0
51 '';
52
53 SETUPTOOLS_SCM_PRETEND_VERSION = version;
54
55 nativeBuildInputs = [
56 pkg-config
57 setuptools-scm
58 setuptools
59 ];
60
61 propagatedBuildInputs = [
62 xcffib
63 (cairocffi.override { withXcffib = true; })
64 python-dateutil
65 dbus-python
66 dbus-next
67 mpd2
68 psutil
69 pyxdg
70 pygobject3
71 pywayland
72 pywlroots
73 xkbcommon
74 pulseaudio
75 ];
76
77 buildInputs = [
78 libinput
79 wayland
80 wlroots
81 libxkbcommon
82 ];
83
84 doCheck = false; # Requires X server #TODO this can be worked out with the existing NixOS testing infrastructure.
85
86 meta = with lib; {
87 homepage = "http://www.qtile.org/";
88 license = licenses.mit;
89 description = "A small, flexible, scriptable tiling window manager written in Python";
90 platforms = platforms.linux;
91 maintainers = with maintainers; [ kamilchm arjan-s ];
92 };
93}