nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib
2, fetchFromGitHub
3, python3
4}:
5
6python3.pkgs.buildPythonApplication rec {
7 pname = "jrnl";
8 version = "3.3";
9 format = "pyproject";
10
11 src = fetchFromGitHub {
12 owner = "jrnl-org";
13 repo = pname;
14 rev = "refs/tags/v${version}";
15 sha256 = "sha256-e2w0E8t6s0OWx2ROme2GdyzWhmCc6hnMfSdLTZqt3bg=";
16 };
17
18 nativeBuildInputs = with python3.pkgs; [
19 poetry-core
20 ];
21
22 propagatedBuildInputs = with python3.pkgs; [
23 ansiwrap
24 asteval
25 colorama
26 cryptography
27 keyring
28 parsedatetime
29 python-dateutil
30 pytz
31 pyxdg
32 pyyaml
33 tzlocal
34 ruamel-yaml
35 rich
36 ];
37
38 nativeCheckInputs = with python3.pkgs; [
39 pytest-bdd
40 pytest-xdist
41 pytestCheckHook
42 toml
43 ];
44
45 # Upstream expects a old pytest-bdd version
46 # Once it changes we should update here too
47 # https://github.com/jrnl-org/jrnl/blob/develop/poetry.lock#L732
48 disabledTests = [
49 "bdd"
50 ];
51
52 postPatch = ''
53 substituteInPlace pyproject.toml \
54 --replace 'rich = "^12.2.0"' 'rich = ">=12.2.0, <14.0.0"'
55 '';
56
57 preCheck = ''
58 export HOME=$(mktemp -d);
59 '';
60
61 pythonImportsCheck = [
62 "jrnl"
63 ];
64
65 meta = with lib; {
66 description = "Simple command line journal application that stores your journal in a plain text file";
67 homepage = "https://jrnl.sh/";
68 license = licenses.gpl3Only;
69 maintainers = with maintainers; [ bryanasdev000 zalakain ];
70 };
71}