about summary refs log tree commit diff
path: root/pkgs/servers/pinnwand/default.nix
blob: 93e2a009c3352c86d21db3ec4e9fc55491d0ce6a (plain) (blame)
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
{ lib
, python3
, fetchFromGitHub
, fetchpatch2
, nixosTests
}:

with python3.pkgs; buildPythonApplication rec {
  pname = "pinnwand";
  version = "1.5.0";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "supakeen";
    repo = pname;
    rev = "refs/tags/v${version}";
    hash = "sha256-1Q/jRjFUoJb1S3cGF8aVuguWMJwYrAtXdKpZV8nRK0k=";
  };

  patches = [
    (fetchpatch2 {
      # fix entrypoint
      url = "https://github.com/supakeen/pinnwand/commit/7868b4b4dcd57066dd0023b5a3cbe91fc5a0a858.patch";
      hash = "sha256-Fln9yJNRvNPHZ0JIgzmwwjUpAHMu55NaEb8ZVDWhLyE=";
    })
  ];

  nativeBuildInputs = [
    pdm-pep517
    pythonRelaxDepsHook
  ];

  pythonRelaxDeps = [
    "docutils"
    "sqlalchemy"
  ];

  propagatedBuildInputs = [
    click
    docutils
    pygments
    pygments-better-html
    python-dotenv
    sqlalchemy
    token-bucket
    tomli
    tornado
  ];

  nativeCheckInputs = [
    pytestCheckHook
  ];

  __darwinAllowLocalNetworking = true;

  passthru.tests = nixosTests.pinnwand;

  meta = with lib; {
    changelog = "https://github.com/supakeen/pinnwand/releases/tag/v${version}";
    description = "A Python pastebin that tries to keep it simple";
    homepage = "https://supakeen.com/project/pinnwand/";
    license = licenses.mit;
    maintainers = with maintainers; [ hexa ];
    mainProgram = "pinnwand";
  };
}