]> git.scottworley.com Git - pinch/blob - default.nix
0eac54594dd222b19d8b5123d05c7c84f54c2ca6
[pinch] / default.nix
1 {
2 pkgs ? import <nixpkgs> { },
3 lint ? false,
4 }:
5
6 let
7 git-cache-fallback =
8 {
9 buildPythonPackage,
10 setuptools,
11 fetchgit,
12 git,
13 backoff,
14 mypy,
15 }:
16 buildPythonPackage rec {
17 pname = "git-cache";
18 version = "1.5.0";
19 src = fetchgit {
20 url = "https://git.scottworley.com/pub/git/git-cache";
21 rev = "v${version}";
22 hash = "sha256-g4TS/zX3e29Q3ThsCAX2wLLlYbi8fdux5uqAc+b/Oww=";
23 };
24 pyproject = true;
25 build-system = [ setuptools ];
26 propagatedBuildInputs = [ backoff ];
27 nativeCheckInputs = [
28 git
29 mypy
30 ];
31 doCheck = true;
32 checkPhase = "./test.sh";
33 };
34
35 in
36 pkgs.python3Packages.callPackage
37 (
38 {
39 lib,
40 buildPythonPackage,
41 setuptools,
42 nix,
43 git,
44 autopep8,
45 mypy,
46 pylint,
47 git-cache,
48 }:
49 buildPythonPackage rec {
50 pname = "pinch";
51 version = "3.3.3-pre";
52 src = lib.cleanSource ./.;
53 pyproject = true;
54 build-system = [ setuptools ];
55 propagatedBuildInputs = [ git-cache ];
56 nativeCheckInputs = [
57 nix
58 git
59 mypy
60 ]
61 ++ lib.optionals lint [
62 autopep8
63 pylint
64 ];
65 doCheck = true;
66 checkPhase = "./test.sh";
67 meta = {
68 description = "A replacement for `nix-channel --update`";
69 homepage = "https://git.scottworley.com/pinch";
70 license = pkgs.lib.licenses.gpl3;
71 maintainers = with pkgs.lib.maintainers; [ chkno ];
72 };
73 }
74 )
75 {
76 git-cache =
77 pkgs.python3Packages.git-cache or (pkgs.python3Packages.callPackage git-cache-fallback { });
78 }