-
Notifications
You must be signed in to change notification settings - Fork 8
/
flake.nix
88 lines (81 loc) · 2.7 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
{
description = "SuperTux 0.4.0 level editor";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-22.05";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
pythonPackages = pkgs.python310Packages;
in rec {
packages = flake-utils.lib.flattenTree rec {
PyQt5-stubs = pythonPackages.buildPythonPackage rec {
pname = "PyQt5-stubs";
version = "5.15.6.0";
src = pythonPackages.fetchPypi {
inherit pname version;
sha256 = "sha256-kScKwj6/OKHcBM2XqoUs0Ir4Lcg5EA5Tla8UR+Pplwc=";
};
};
flexlay = pythonPackages.buildPythonPackage rec {
pname = "flexlay";
version = "0.2.0";
src = ./.;
nativeBuildInputs = [ pkgs.qt5.wrapQtAppsHook ];
makeWrapperArgs = [
"\${qtWrapperArgs[@]}"
"--set" "LIBGL_DRIVERS_PATH" "${pkgs.mesa.drivers}/lib/dri"
"--prefix" "LD_LIBRARY_PATH" ":" "${pkgs.mesa.drivers}/lib"
];
preCheck = ''
export QT_QPA_PLATFORM_PLUGIN_PATH="${pkgs.qt5.qtbase.bin}/lib/qt-${pkgs.qt5.qtbase.version}/plugins";
# export QT_QPA_PLATFORM=offscreen
'';
checkPhase = ''
runHook preCheck
flake8 flexlay supertux tests
# pyright flexlay supertux tests
# mypy flexlay supertux tests
# pylint flexlay supertux tests
# HOME=$TMP python3 -m unittest discover -v -s tests/
runHook postCheck
'';
propagatedBuildInputs = [
pkgs.xorg.libxcb
pythonPackages.setuptools
pythonPackages.numpy
pythonPackages.pyqt5
pythonPackages.pyqt5_sip
pythonPackages.pyxdg
];
checkInputs = (with pkgs; [
pyright
]) ++ (with pythonPackages; [
flake8
mypy
pylint
types-setuptools
pyannotate
]) ++ [
PyQt5-stubs
];
};
flexlay-nocheck = flexlay.override {
doCheck = false;
};
default = flexlay;
};
devShells = rec {
flexlay-dev = pkgs.mkShell {
inputsFrom = [ packages.flexlay ];
shellHook = packages.flexlay.preCheck + ''
# runHook setuptoolsShellHook
'';
};
default = flexlay-dev;
};
}
);
}