From: Scott Worley Date: Mon, 18 May 2020 18:47:10 +0000 (-0700) Subject: Only add pinch if not already present X-Git-Url: http://git.scottworley.com/auto-upgrade-with-pinch/commitdiff_plain/9221389b9029a61eebedde615ab5c8b52aec7914?ds=sidebyside;hp=2b58720b22980359a9b76a615dd11b75b956574b Only add pinch if not already present --- diff --git a/overlays/pinch.nix b/overlays/pinch.nix index 1b2c65f..3399609 100644 --- a/overlays/pinch.nix +++ b/overlays/pinch.nix @@ -1,9 +1,14 @@ self: super: { - pinch = super.writeShellScriptBin "pinch" '' - exec ${self.python3}/bin/python3 ${super.fetchgit { - url = "https://scottworley.com/pinch.git"; - rev = "1.1"; - sha256 = "0ilbhvr0d83kfwkm7ak64gik44gi2axfnp9rzsa7g5cwz9qaxdbv"; - }}/pinch.py "$@" - ''; + pinch = if builtins.hasAttr "pinch" super then + super.pinch + else + super.writeShellScriptBin "pinch" '' + exec ${self.python3}/bin/python3 ${ + super.fetchgit { + url = "https://scottworley.com/pinch.git"; + rev = "1.1"; + sha256 = "0ilbhvr0d83kfwkm7ak64gik44gi2axfnp9rzsa7g5cwz9qaxdbv"; + } + }/pinch.py "$@" + ''; }