]> git.scottworley.com Git - auto-upgrade-with-pinch/blobdiff - overlays/pinch.nix
Safe defaults
[auto-upgrade-with-pinch] / overlays / pinch.nix
index 3399609f65ad8ba8ac4786da0ea1c29a2d0ae455..0dad303f43242c049b5c3f4af50bfec1047348db 100644 (file)
@@ -2,13 +2,18 @@ self: super: {
   pinch = if builtins.hasAttr "pinch" super then
     super.pinch
   else
-    super.writeShellScriptBin "pinch" ''
-      exec ${self.python3}/bin/python3 ${
-        super.fetchgit {
+    self.python3Packages.callPackage
+    ({ buildPythonPackage, fetchgit, nix, git, mypy, }:
+      buildPythonPackage rec {
+        pname = "pinch";
+        version = "1.5";
+        src = fetchgit {
           url = "https://scottworley.com/pinch.git";
-          rev = "1.1";
-          sha256 = "0ilbhvr0d83kfwkm7ak64gik44gi2axfnp9rzsa7g5cwz9qaxdbv";
-        }
-      }/pinch.py "$@"
-    '';
+          rev = version;
+          sha256 = "0si7z78iy8b5dfjs8ijy8bq9fwcfq51syqxijkc6mg5m7awwsf3l";
+        };
+        checkInputs = [ nix git mypy ];
+        doCheck = true;
+        checkPhase = "./test.sh";
+      }) { };
 }