forked from qtile/qtile
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
120 lines (101 loc) · 2.79 KB
/
Copy pathflake.nix
File metadata and controls
120 lines (101 loc) · 2.79 KB
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
109
110
111
112
113
114
115
116
117
118
119
120
{
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)
);
flake-attributes = forAllSystems (pkgs: rec {
build-config = import ./nix/build-config.nix pkgs;
common-python-deps = with pkgs.python3Packages; [
python-dateutil
# docs building
numpydoc
sphinx
sphinx_rtd_theme
# tests
coverage
pytest
isort
];
tests = {
wayland = pkgs.writeScriptBin "qtile-run-tests-wayland" ''
pytest -x --backend=wayland
'';
x11 = pkgs.writeScriptBin "qtile-run-tests-x11" ''
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
imagemagick
pre-commit
];
shell-env = {
LD_LIBRARY_PATH =
with pkgs;
lib.makeLibraryPath [
glib
pango
xcb-util-cursor
pixman
libdrm.dev
];
}
// build-config.resolved-env-vars;
pkgs-wrapped = pkgs.lib.lists.flatten [
common-python-deps
common-system-deps
(builtins.attrValues tests)
];
});
in
{
formatter = forAllSystems (pkgs: pkgs.nixfmt-rfc-style);
checks = forAllSystems (pkgs: pkgs.python3Packages.qtile.passthru.tests);
packages = forAllSystems (pkgs: {
inherit (pkgs.python3Packages) qtile;
default = self.packages.${pkgs.system}.qtile;
});
devShells = forAllSystems (pkgs: {
default = pkgs.mkShell {
env = flake-attributes.${pkgs.system}.shell-env;
shellHook = ''
export PYTHONPATH=$(readlink -f .):$PYTHONPATH
'';
inputsFrom = [ self.packages.${pkgs.system}.qtile ];
packages = flake-attributes.${pkgs.system}.pkgs-wrapped;
};
});
};
}