summaryrefslogtreecommitdiffstats
path: root/default.nix
blob: b83484fb4de2f3725355d448dd900ac8be1cdc11 (plain)
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
121
122
123
124
125
126
127
128
129
130
131
with import <nixpkgs> {};

let
  upstream = with pkgs.python3Packages; {
    inherit buildPythonPackage;
    inherit fetchPypi;

    inherit blinker;
    inherit cachetools;
    inherit cryptography;
    inherit cython;
    inherit flask;
    inherit flask_login;
    inherit flask_sqlalchemy;
    inherit flask_wtf;
    inherit mock;
    inherit prometheus_client;
    inherit pyjwt;
    inherit pytest;
    inherit qrcode;
    inherit raspberrypi-tools;
    inherit requests;
    inherit six;
  };

in with upstream; let
  websocket_client = buildPythonPackage rec {
    version = "0.40.0";
    pname = "websocket_client";
  
    src = fetchPypi {
      inherit pname version;
      sha256 = "1yz67wdjijrvwpx0a0f6wdfy8ajsvr9xbj5514ld452fqnh19b20";
    };
  
    propagatedBuildInputs = [
      six
    ];
  };

  oauthlib = buildPythonPackage rec {
    pname = "oauthlib";
    version = "2.1.0";
    src = fetchPypi {
      inherit pname version;
      sha256 = "0qj183fipjzw6ipiv2k10896y97sxvargnkb6db5qs61c5d6cddc";
    };

    checkInputs = [ mock pytest ];
    propagatedBuildInputs = [ cryptography blinker pyjwt ];

    checkPhase = ''
      py.test tests/
    '';
  };

  requests_oauthlib = buildPythonPackage rec {
    pname = "requests-oauthlib";
    version = "1.0.0";
    src = fetchPypi {
      inherit pname version;
      sha256 = "0gys581rqjdlv0whhqp5s2caxx66jzvb2hslxn8v7bypbbnbz1l8";
    };

    doCheck = false;
    propagatedBuildInputs = [ oauthlib requests ];
  };

  flask_oauthlib = buildPythonPackage rec {
    pname = "Flask-OAuthlib";
    version = "0.9.5";
    src = fetchPypi {
      inherit pname version;
      sha256 = "01llysn53jfrr9n02hvjcynrb28lh4rjqn18k2hhk6an09cq7znb";
    };

    doCheck = false;
    propagatedBuildInputs = [ flask flask_sqlalchemy requests_oauthlib oauthlib ];
  };

  spaceauth = buildPythonPackage rec {
    pname = "Flask-SpaceAuth";
    version = "0.2.0";

    src = pkgs.fetchgit {
      url = "https://code.hackerspace.pl/informatic/flask-spaceauth";
      rev = "v${version}";
      sha256 = "000vg41lw4pyd10bvcqrp15y673qlpkllgppfhm48w7vk02r6zi2";
    };

    propagatedBuildInputs = [ flask flask_login flask_oauthlib flask_wtf requests ];
  };

  pigpio = stdenv.mkDerivation rec {
    pname = "pigpio";
    version = "74-q3k";
    installFlags = [ "DESTDIR=$(out)" "prefix=" ];

    src = pkgs.fetchFromGitHub {
      owner = "q3k";
      repo = "pigpio";
      rev = "5a0b27c997631b3ba1a7778a176b6f5462233be4";
      sha256 = "1b55bzfsyghd2lrfqmz6g935zsmwnhbcscb4g11hxm3g7a68g9vv";
    };

    propagatedBuildInputs = [ raspberrypi-tools ];
  };

  cygpio = buildPythonPackage {
    pname = "cygpio";
    version = "1.0.0";
    src = ./cygpio;
    propagatedBuildInputs = [ pigpio cython ];
  };

in buildPythonPackage rec {
  name = "bitvend";
  src = ./.;
  doCheck = false;
  propagatedBuildInputs = [
    cygpio
    flask
    flask_sqlalchemy
    websocket_client
    cachetools
    requests
    prometheus_client
    spaceauth
    qrcode
  ];
}