]> git.scottworley.com Git - git-cache/blobdiff - default.nix
Adapt to nixpkgs' nativeCheckInputs change
[git-cache] / default.nix
index 527bd14633a33bd3a49d3b64d2cdc022dbebca28..d2337001f358cca6a852fa39f7b5452404d3bed1 100644 (file)
@@ -1,34 +1,25 @@
 { pkgs ? import <nixpkgs> { }, lint ? false }:
 
 let
-  # Remove this package definition after https://github.com/NixOS/nixpkgs/pull/93377 reaches stable
-  backoff-fallback = { lib, buildPythonPackage, fetchPypi }:
-    buildPythonPackage rec {
-      pname = "backoff";
-      version = "1.10.0";
-      src = fetchPypi {
-        inherit pname version;
-        sha256 = "190rdpfhpjvb6bjh99fhdkgfsfkjwky7nz7b0nn5ah67z8hs1yxq";
-      };
-      meta = with lib; {
-        description = "Function decoration for backoff and retry";
-        homepage = "https://github.com/litl/backoff";
-        license = licenses.mit;
-        maintainers = with maintainers; [ chkno ];
-      };
-    };
-
+  checkInputsAreNative = pkgs.lib.hasInfix "nativeCheckInputs"
+    (builtins.readFile <nixpkgs/doc/stdenv/stdenv.chapter.md>);
+  checkInputsName =
+    if checkInputsAreNative then "nativeCheckInputs" else "checkInputs";
 in pkgs.python3Packages.callPackage
 ({ lib, buildPythonPackage, nix, git, backoff, autopep8, mypy, pylint, }:
   buildPythonPackage rec {
     pname = "git-cache";
-    version = "1.4.0-pre";
+    version = "1.4.2";
     src = lib.cleanSource ./.;
     propagatedBuildInputs = [ backoff ];
-    checkInputs = [ nix git mypy ] ++ lib.optionals lint [ autopep8 pylint ];
+    "${checkInputsName}" = [ nix git mypy ]
+      ++ lib.optionals lint [ autopep8 pylint ];
     doCheck = true;
     checkPhase = "./test.sh";
-  }) {
-    backoff = pkgs.python3Packages.backoff or (pkgs.python3Packages.callPackage
-      backoff-fallback { });
-  }
+    meta = {
+      description = "Cache git content locally";
+      homepage = "https://git.scottworley.com/git-cache";
+      license = pkgs.lib.licenses.gpl3;
+      maintainers = with pkgs.lib.maintainers; [ chkno ];
+    };
+  }) { }