-
-
Notifications
You must be signed in to change notification settings - Fork 15.2k
/
Copy pathpackage.nix
82 lines (76 loc) · 2.2 KB
/
package.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
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
{
lib,
fetchFromGitHub,
python3,
}:
let
py-pkgs = python.pkgs;
python = python3.override {
packageOverrides = self: super: {
# Current nixpkgs version is too outdated, causes crash on startup
pydantic-settings = (
super.pydantic-settings.overrideAttrs (oldAttrs: rec {
version = "2.6.0";
src = fetchFromGitHub {
owner = "pydantic";
repo = "pydantic-settings";
rev = "refs/tags/v${version}";
hash = "sha256-gJThzYJg6OIkfmfi/4MVINsrvmg+Z+0xMhdlCj7Fn+w=";
};
propagatedBuildInputs = [
super.pydantic
super.python-dotenv
];
})
);
# Current nixpkgs version is too outdated, posting maintainer
# explicitly warns against relaxing this dependency
textual = (
super.textual.overrideAttrs (oldAttrs: rec {
version = "0.85.0";
src = fetchFromGitHub {
owner = "Textualize";
repo = "textual";
rev = "refs/tags/v${version}";
hash = "sha256-ROq/Pjq6XRgi9iqMlCzpLmgzJzLl21MI7148cOxHS3o=";
};
})
);
};
};
in
py-pkgs.buildPythonApplication rec {
pname = "posting";
version = "2.0.1";
pyproject = true;
src = fetchFromGitHub {
owner = "darrenburns";
repo = "posting";
rev = "refs/tags/${version}";
sha256 = "sha256-6KtC5VuG3x07VTenpyDAJr9KO4jdTCFk1u/pSoyYPsc=";
};
patches = [ ./relax-pyproject.patch ];
nativeBuildInputs = [ py-pkgs.hatchling ];
dependencies = [
py-pkgs.click
py-pkgs.xdg-base-dirs
py-pkgs.click-default-group
py-pkgs.pyperclip
py-pkgs.pyyaml
py-pkgs.python-dotenv
py-pkgs.watchfiles
py-pkgs.pydantic
py-pkgs.pydantic-settings
py-pkgs.httpx
py-pkgs.textual
py-pkgs.textual-autocomplete
] ++ py-pkgs.textual.optional-dependencies.syntax ++ py-pkgs.httpx.optional-dependencies.brotli;
meta = {
description = "The modern API client that lives in your terminal.";
mainProgram = "posting";
homepage = "https://posting.sh/";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ jorikvanveen ];
platforms = lib.platforms.unix;
};
}