forked from qtile/qtile
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
108 lines (89 loc) · 2.6 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
{
description = "Qtile's flake, full-featured, hackable tiling window manager written and configured in Python";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
};
outputs = { self, nixpkgs }: let
supportedSystems = [ "x86_64-linux" "aarch64-linux" ];
forAllSystems = function:
nixpkgs.lib.genAttrs supportedSystems
(system: let
nixpkgs-settings = {
inherit system;
overlays = [
(import ./nix/overlays.nix self)
];
};
in function (import nixpkgs nixpkgs-settings));
in {
checks = forAllSystems (pkgs: pkgs.python3Packages.qtile.passthru.tests);
overlays.default = import ./nix/overlays.nix self;
packages = forAllSystems (pkgs: let
qtile' = pkgs.python3Packages.qtile;
in {
default = self.packages.${pkgs.system}.qtile;
qtile = qtile'.overrideAttrs (prev: {
name = "${qtile'.pname}-${qtile'.version}";
passthru.unwrapped = qtile';
});
});
devShells = forAllSystems (pkgs: let
common-python-deps = ps: with ps;
[ python-dateutil ]
++ [
# docs building
numpydoc
sphinx
sphinx_rtd_theme
# tests
coverage
pytest
];
tests = {
wayland = pkgs.writeScriptBin "qtile-run-tests-wayland" ''
./scripts/ffibuild -v
pytest -x --backend=wayland
'';
x11 = pkgs.writeScriptBin "qtile-run-tests-x11" ''
./scripts/ffibuild -v
pytest -x --backend=x11
'';
};
common-system-deps = with pkgs; [
# Gdk namespaces
wrapGAppsHook
gobject-introspection
# docs graphs
graphviz
# x11 deps
xorg.xorgserver
xorg.libX11
wlroots_0_17
# test/backend/wayland/test_window.py
gtk-layer-shell
] ++ (builtins.attrValues tests);
in {
default = pkgs.mkShell {
env = {
QTILE_PIXMAN_PATH = "${pkgs.pixman}/include/pixman-1";
QTILE_LIBDRM_PATH = "${pkgs.libdrm.dev}/include/libdrm";
LD_LIBRARY_PATH = with pkgs; lib.makeLibraryPath [
glib
pango
xcb-util-cursor
pixman
libdrm.dev
];
};
shellHook = ''
export PYTHONPATH=$(readlink -f .):$PYTHONPATH
'';
inputsFrom = [ self.packages.${pkgs.system}.qtile ];
packages = with pkgs; [
(python3.withPackages common-python-deps)
pre-commit
] ++ common-system-deps;
};
});
};
}