1 { pkgs ? import <nixpkgs> { }, lint ? false }:
4 checkInputsAreNative = pkgs.lib.hasInfix "nativeCheckInputs"
5 (builtins.readFile <nixpkgs/doc/stdenv/stdenv.chapter.md>);
7 if checkInputsAreNative then "nativeCheckInputs" else "checkInputs";
9 git-cache-fallback = { buildPythonPackage, fetchgit, git, backoff, mypy, }:
10 buildPythonPackage rec {
14 url = "https://git.scottworley.com/pub/git/git-cache";
16 hash = "sha256-g4TS/zX3e29Q3ThsCAX2wLLlYbi8fdux5uqAc+b/Oww=";
18 propagatedBuildInputs = [ backoff ];
19 "${checkInputsName}" = [ git mypy ];
21 checkPhase = "./test.sh";
24 in pkgs.python3Packages.callPackage ({ lib, buildPythonPackage, nix_2_3, git
25 , autopep8, makeWrapper, mypy, pylint, git-cache, }:
26 buildPythonPackage rec {
28 version = "3.1.0-pre";
29 src = lib.cleanSource ./.;
30 buildInputs = [ makeWrapper ];
31 propagatedBuildInputs = [ git-cache ];
32 "${checkInputsName}" = [ nix_2_3 git mypy ]
33 ++ lib.optionals lint [ autopep8 pylint ];
35 wrapProgram "$out/bin/pinch" --prefix PATH : ${nix_2_3}/bin
38 checkPhase = "./test.sh";
40 description = "A replacement for `nix-channel --update`";
41 homepage = "https://git.scottworley.com/pinch";
42 license = pkgs.lib.licenses.gpl3;
43 maintainers = with pkgs.lib.maintainers; [ chkno ];
47 pkgs.python3Packages.git-cache or (pkgs.python3Packages.callPackage
48 git-cache-fallback { });
49 nix_2_3 = pkgs.nix_2_3 or pkgs.nix;