]> git.scottworley.com Git - auto-upgrade-with-pinch/blob - overlays/pinch.nix
5a2eaff1d436810637133a2c94d0921f29deae5c
[auto-upgrade-with-pinch] / overlays / pinch.nix
1 self: super:
2 let
3 checkInputsAreNative = self.lib.hasInfix "nativeCheckInputs"
4 (builtins.readFile <nixpkgs/doc/stdenv/stdenv.chapter.md>);
5 checkInputsName =
6 if checkInputsAreNative then "nativeCheckInputs" else "checkInputs";
7
8 fallback-git-cache = self.python3Packages.callPackage
9 ({ buildPythonPackage, fetchgit, git, backoff, mypy, }:
10 buildPythonPackage rec {
11 pname = "git-cache";
12 version = "1.4.3";
13 src = fetchgit {
14 url = "https://git.scottworley.com/pub/git/git-cache";
15 rev = "v${version}";
16 hash = "sha256-Qr62bGdlFFkzYTl6ot34UiOJxbP1Eeelx2OEd96vrqI=";
17 };
18 propagatedBuildInputs = [ backoff ];
19 "${checkInputsName}" = [ git mypy ];
20 doCheck = true;
21 checkPhase = "./test.sh";
22 }) { };
23
24 fallback-pinch = self.python3Packages.callPackage
25 ({ buildPythonPackage, fetchgit, nix_2_3, git, makeWrapper, mypy, git-cache, }:
26 buildPythonPackage rec {
27 pname = "pinch";
28 version = "3.0.13";
29 src = fetchgit {
30 url = "https://git.scottworley.com/pub/git/pinch";
31 rev = "v${version}";
32 hash = "sha256-GGl16qDinNWe7qVnkfFJWNZiLb71sLZTHQ04a9g/26k=";
33 };
34 buildInputs = [ makeWrapper ];
35 propagatedBuildInputs = [ git-cache ];
36 "${checkInputsName}" = [ nix_2_3 git mypy ];
37 postInstall = ''
38 wrapProgram "$out/bin/pinch" --prefix PATH : ${nix_2_3}/bin
39 '';
40 doCheck = true;
41 checkPhase = "./test.sh";
42 }) { git-cache = self.python3Packages.git-cache or fallback-git-cache; };
43
44 in { pinch = super.pinch or fallback-pinch; }