-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathdefault.nix
49 lines (40 loc) · 1.01 KB
/
default.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
{ pkgs ? import <nixpkgs> {}
, lib ? pkgs.lib
, kisstdlib ? import ../vendor/kisstdlib { inherit pkgs; }
, cbor2 ? import ../vendor/cbor2 { inherit pkgs; }
, source ? import ../source.nix { inherit pkgs; }
, developer ? false
, mitmproxySupport ? true
}:
let mycbor2 = cbor2; in
with pkgs.python3Packages;
buildPythonApplication (rec {
pname = "hoardy-web";
version = "0.23.0";
format = "pyproject";
inherit (source) src unpackPhase;
sourceRoot = "${src.name}/tool";
propagatedBuildInputs = [
setuptools
kisstdlib
sortedcontainers
mycbor2
idna
html5lib
tinycss2
bottle
]
++ lib.optional mitmproxySupport mitmproxy;
postInstall = ''
patchShebangs script
install -m 755 -t $out/bin script/hoardy-*
'';
} // lib.optionalAttrs developer {
nativeBuildInputs = [
build twine pip mypy pytest black pylint
pkgs.pandoc
kisstdlib # for `describe-dir` binary
];
preBuild = "find . ; black --check . && mypy && pytest && pylint .";
postFixup = "find $out";
})