-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpackage.nix
47 lines (39 loc) · 1.32 KB
/
package.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
{ inputs, lib, ... }@args: self: super: rec {
pyserver = super.python3Packages.buildPythonApplication rec {
pname = "pyserver";
version = "0.0.1";
pyproject = true;
src = fetchPypi {
inherit pname version;
hash = "sha256-fba6fca9ee179e239ec34ef8cbd56331c46ad89e428c9db9c475c794f5fdb673";
};
# If no `checkPhase` is specified, `python setup.py test` is executed
# by default as long as `doCheck` is true (the default).
# I want to run my tests in a different way:
checkPhase = ''
python -m unittest $(find tests -name "*.py")
'';
installPhase = ''install -Dm755 pyserver.py $out/bin/pyserver'';
preFixup = ''
makeWrapperArgs+=(--prefix PATH : ${args.lib.makeBinPath [
# Hard requirements
super.python3Packages.colorlog
]})
'';
build-system = with python3Packages; [
setuptools
];
dependencies = with python3Packages; [
colorlog
];
# Meta information for the package
meta = with lib; {
description = "A simple multithreaded HTTP server with fancy directory listing and logging";
homepage = "https://github.com/Red-Flake/pyserver";
license = licenses.mit;
maintainers = with maintainers; [ Mag1cByt3s ];
platforms = lib.platforms.all;
mainProgram = "pyserver";
};
};
}