nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 fetchFromGitHub,
4 python3,
5 installShellFiles,
6 fetchpatch,
7}:
8
9python3.pkgs.buildPythonApplication rec {
10 pname = "watson";
11 version = "2.1.0";
12 pyproject = true;
13
14 src = fetchFromGitHub {
15 owner = "jazzband";
16 repo = "Watson";
17 rev = version;
18 sha256 = "sha256-/AASYeMkt18KPJljAjNPRYOpg/T5xuM10LJq4LrFD0g=";
19 };
20
21 patches = [
22 # https://github.com/jazzband/Watson/pull/473
23 (fetchpatch {
24 name = "fix-completion.patch";
25 url = "https://github.com/jazzband/Watson/commit/43ad061a981eb401c161266f497e34df891a5038.patch";
26 sha256 = "sha256-v8/asP1wooHKjyy9XXB4Rtf6x+qmGDHpRoHEne/ZCxc=";
27 })
28 ];
29
30 nativeBuildInputs = [ installShellFiles ];
31
32 build-system = with python3.pkgs; [ setuptools ];
33
34 dependencies = with python3.pkgs; [
35 arrow
36 click
37 click-didyoumean
38 requests
39 ];
40
41 nativeCheckInputs = with python3.pkgs; [
42 pytestCheckHook
43 pytest-mock
44 mock
45 pytest-datafiles
46 ];
47
48 postInstall = ''
49 installShellCompletion --bash --name watson watson.completion
50 installShellCompletion --zsh --name _watson watson.zsh-completion
51 installShellCompletion --fish watson.fish
52 '';
53
54 pythonImportsCheck = [ "watson" ];
55
56 meta = {
57 homepage = "https://github.com/jazzband/Watson";
58 description = "Wonderful CLI to track your time";
59 mainProgram = "watson";
60 license = lib.licenses.mit;
61 maintainers = with lib.maintainers; [
62 mguentner
63 nathyong
64 oxzi
65 ];
66 };
67}