]> git.scottworley.com Git - pinch/blob - default.nix
94f525bb33fbe26401f462df744ae5c622d218d1
[pinch] / default.nix
1 { pkgs ? import <nixpkgs> { }, lint ? false }:
2
3 let
4
5 git-cache-fallback = { buildPythonPackage, fetchgit, git, backoff, mypy, }:
6 buildPythonPackage rec {
7 pname = "git-cache";
8 version = "1.4.2";
9 src = fetchgit {
10 url = "https://git.scottworley.com/pub/git/git-cache";
11 rev = "v${version}";
12 hash = "sha256-Z9daNCmjzaVdeG3mITRWdNM+ewUEcKy5N4/Xpdotsg0=";
13 };
14 propagatedBuildInputs = [ backoff ];
15 checkInputs = [ git mypy ];
16 doCheck = true;
17 checkPhase = "./test.sh";
18 };
19
20 in pkgs.python3Packages.callPackage ({ lib, buildPythonPackage, nix_2_3, git
21 , autopep8, makeWrapper, mypy, pylint, git-cache, }:
22 buildPythonPackage rec {
23 pname = "pinch";
24 version = "3.0.10";
25 src = lib.cleanSource ./.;
26 buildInputs = [ makeWrapper ];
27 propagatedBuildInputs = [ git-cache ];
28 checkInputs = [ nix_2_3 git mypy ] ++ lib.optionals lint [ autopep8 pylint ];
29 postInstall = ''
30 wrapProgram "$out/bin/pinch" --prefix PATH : ${nix_2_3}/bin
31 '';
32 doCheck = true;
33 checkPhase = "./test.sh";
34 meta = {
35 description = "A replacement for `nix-channel --update`";
36 homepage = "https://git.scottworley.com/pinch";
37 license = pkgs.lib.licenses.gpl3;
38 maintainers = with pkgs.lib.maintainers; [ chkno ];
39 };
40 }) {
41 git-cache =
42 pkgs.python3Packages.git-cache or (pkgs.python3Packages.callPackage
43 git-cache-fallback { });
44 nix_2_3 = pkgs.nix_2_3 or pkgs.nix;
45 }