]> git.scottworley.com Git - pinch/blob - default.nix
Release 3.3.1
[pinch] / default.nix
1 { pkgs ? import <nixpkgs> { }, lint ? false }:
2
3 let
4 checkInputsAreNative = pkgs.lib.hasInfix "nativeCheckInputs"
5 (builtins.readFile <nixpkgs/doc/stdenv/stdenv.chapter.md>);
6 checkInputsName =
7 if checkInputsAreNative then "nativeCheckInputs" else "checkInputs";
8
9 git-cache-fallback = { buildPythonPackage, fetchgit, git, backoff, mypy, }:
10 buildPythonPackage rec {
11 pname = "git-cache";
12 version = "1.5.0";
13 src = fetchgit {
14 url = "https://git.scottworley.com/pub/git/git-cache";
15 rev = "v${version}";
16 hash = "sha256-g4TS/zX3e29Q3ThsCAX2wLLlYbi8fdux5uqAc+b/Oww=";
17 };
18 propagatedBuildInputs = [ backoff ];
19 "${checkInputsName}" = [ git mypy ];
20 doCheck = true;
21 checkPhase = "./test.sh";
22 };
23
24 in pkgs.python3Packages.callPackage
25 ({ lib, buildPythonPackage, nix, git, autopep8, mypy, pylint, git-cache, }:
26 buildPythonPackage rec {
27 pname = "pinch";
28 version = "3.3.1";
29 src = lib.cleanSource ./.;
30 propagatedBuildInputs = [ git-cache ];
31 "${checkInputsName}" = [ nix git mypy ]
32 ++ lib.optionals lint [ autopep8 pylint ];
33 doCheck = true;
34 checkPhase = "./test.sh";
35 meta = {
36 description = "A replacement for `nix-channel --update`";
37 homepage = "https://git.scottworley.com/pinch";
38 license = pkgs.lib.licenses.gpl3;
39 maintainers = with pkgs.lib.maintainers; [ chkno ];
40 };
41 }) {
42 git-cache =
43 pkgs.python3Packages.git-cache or (pkgs.python3Packages.callPackage
44 git-cache-fallback { });
45 }