···117 else throw "fetchurl requires either `url` or `urls` to be set";
118119 hash_ =
000120 if hash != "" then { outputHashAlgo = null; outputHash = hash; }
121 else if md5 != "" then throw "fetchurl does not support md5 anymore, please use sha256 or sha512"
122 else if (outputHash != "" && outputHashAlgo != "") then { inherit outputHashAlgo outputHash; }
···117 else throw "fetchurl requires either `url` or `urls` to be set";
118119 hash_ =
120+ # Many other combinations don't make sense, but this is the most common one:
121+ if hash != "" && sha256 != "" then throw "multiple hashes passed to fetchurl" else
122+123 if hash != "" then { outputHashAlgo = null; outputHash = hash; }
124 else if md5 != "" then throw "fetchurl does not support md5 anymore, please use sha256 or sha512"
125 else if (outputHash != "" && outputHashAlgo != "") then { inherit outputHashAlgo outputHash; }
+12-12
pkgs/servers/home-assistant/default.nix
···95 (self: super: {
96 pytest-aiohttp = super.pytest-aiohttp.overridePythonAttrs (oldAttrs: rec {
97 version = "0.3.0";
98- src = oldAttrs.src.override {
99 inherit version;
0100 hash = "sha256-ySmFQzljeXc3WDhwO2L+9jUoWYvAqdRRY566lfSqpE8=";
101 };
102 propagatedBuildInputs = with python3.pkgs; [ aiohttp pytest ];
···142 })
143144 # Pinned due to API changes in 0.1.0
145- (mkOverride "poolsense" "0.0.8" "sha256-17MHrYRmqkH+1QLtgq2d6zaRtqvb9ju9dvPt9gB2xCc=")
000000000146147 # Pinned due to API changes >0.3.5.3
148 (self: super: {
···273 home-assistant-frontend = self.callPackage ./frontend.nix { };
274 })
275 ];
276-277- mkOverride = attrName: version: hash:
278- self: super: {
279- ${attrName} = super.${attrName}.overridePythonAttrs (oldAttrs: {
280- inherit version;
281- src = oldAttrs.src.override {
282- inherit version hash;
283- };
284- });
285- };
286287 python = python3.override {
288 # Put packageOverrides at the start so they are applied after defaultOverrides
···95 (self: super: {
96 pytest-aiohttp = super.pytest-aiohttp.overridePythonAttrs (oldAttrs: rec {
97 version = "0.3.0";
98+ src = self.fetchPypi {
99 inherit version;
100+ pname = "pytest-aiohttp";
101 hash = "sha256-ySmFQzljeXc3WDhwO2L+9jUoWYvAqdRRY566lfSqpE8=";
102 };
103 propagatedBuildInputs = with python3.pkgs; [ aiohttp pytest ];
···143 })
144145 # Pinned due to API changes in 0.1.0
146+ (self: super: {
147+ poolsense = super.poolsense.overridePythonAttrs (oldAttrs: rec {
148+ version = "0.0.8";
149+ src = super.fetchPypi {
150+ pname = "poolsense";
151+ inherit version;
152+ hash = "sha256-17MHrYRmqkH+1QLtgq2d6zaRtqvb9ju9dvPt9gB2xCc=";
153+ };
154+ });
155+ })
156157 # Pinned due to API changes >0.3.5.3
158 (self: super: {
···283 home-assistant-frontend = self.callPackage ./frontend.nix { };
284 })
285 ];
0000000000286287 python = python3.override {
288 # Put packageOverrides at the start so they are applied after defaultOverrides