fetchItchIo: fix SSL error and improve missing envvar message (#498540)

This commit is contained in:
Philip Taron
2026-03-11 21:08:06 +00:00
committed by GitHub
2 changed files with 12 additions and 7 deletions
+6 -1
View File
@@ -1,6 +1,7 @@
{
lib,
stdenvNoCC,
cacert,
python3,
}:
@@ -78,7 +79,11 @@ lib.extendMkDerivation {
outputHashAlgo = if finalHashHasColon then lib.head finalHashColonMatch else null;
outputHashMode = "flat";
nativeBuildInputs = [ python3 ] ++ nativeBuildInputs;
nativeBuildInputs = [
cacert
python3
]
++ nativeBuildInputs;
inherit preferLocalBuild;
@@ -4,7 +4,6 @@ import os
import platform
import shutil
import sys
import urllib.error
import urllib.parse
import urllib.request
@@ -24,13 +23,14 @@ def abort(message):
print(message, file=sys.stderr)
sys.exit(1)
try:
API_KEY = os.environ[ENV['apiKeyVar']]
except KeyError:
API_KEY = os.environ.get(ENV['apiKeyVar'])
if not API_KEY:
abort(
f'Either set {ENV['apiKeyVar']} for the nix building process '
f'Error: Either set the environment variable {ENV['apiKeyVar']} '
'(for the nix-daemon in multi user mode) '
f'or manually download {ENV.get('uploadName', 'the required file')} '
f'from {GAME_URL} and add it to nix store.'
f'from {GAME_URL} and add it to the nix store.'
)
def urlopen(url_or_request):