···117117 else throw "fetchurl requires either `url` or `urls` to be set";
118118119119 hash_ =
120120+ # Many other combinations don't make sense, but this is the most common one:
121121+ if hash != "" && sha256 != "" then throw "multiple hashes passed to fetchurl" else
122122+120123 if hash != "" then { outputHashAlgo = null; outputHash = hash; }
121124 else if md5 != "" then throw "fetchurl does not support md5 anymore, please use sha256 or sha512"
122125 else if (outputHash != "" && outputHashAlgo != "") then { inherit outputHashAlgo outputHash; }
+12-12
pkgs/servers/home-assistant/default.nix
···9595 (self: super: {
9696 pytest-aiohttp = super.pytest-aiohttp.overridePythonAttrs (oldAttrs: rec {
9797 version = "0.3.0";
9898- src = oldAttrs.src.override {
9898+ src = self.fetchPypi {
9999 inherit version;
100100+ pname = "pytest-aiohttp";
100101 hash = "sha256-ySmFQzljeXc3WDhwO2L+9jUoWYvAqdRRY566lfSqpE8=";
101102 };
102103 propagatedBuildInputs = with python3.pkgs; [ aiohttp pytest ];
···142143 })
143144144145 # Pinned due to API changes in 0.1.0
145145- (mkOverride "poolsense" "0.0.8" "sha256-17MHrYRmqkH+1QLtgq2d6zaRtqvb9ju9dvPt9gB2xCc=")
146146+ (self: super: {
147147+ poolsense = super.poolsense.overridePythonAttrs (oldAttrs: rec {
148148+ version = "0.0.8";
149149+ src = super.fetchPypi {
150150+ pname = "poolsense";
151151+ inherit version;
152152+ hash = "sha256-17MHrYRmqkH+1QLtgq2d6zaRtqvb9ju9dvPt9gB2xCc=";
153153+ };
154154+ });
155155+ })
146156147157 # Pinned due to API changes >0.3.5.3
148158 (self: super: {
···273283 home-assistant-frontend = self.callPackage ./frontend.nix { };
274284 })
275285 ];
276276-277277- mkOverride = attrName: version: hash:
278278- self: super: {
279279- ${attrName} = super.${attrName}.overridePythonAttrs (oldAttrs: {
280280- inherit version;
281281- src = oldAttrs.src.override {
282282- inherit version hash;
283283- };
284284- });
285285- };
286286287287 python = python3.override {
288288 # Put packageOverrides at the start so they are applied after defaultOverrides