diff --git a/pkgs/build-support/fetchitchio/default.nix b/pkgs/build-support/fetchitchio/default.nix index 186c25f8542f..de45996c3ac1 100644 --- a/pkgs/build-support/fetchitchio/default.nix +++ b/pkgs/build-support/fetchitchio/default.nix @@ -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; diff --git a/pkgs/build-support/fetchitchio/fetchitchio.py b/pkgs/build-support/fetchitchio/fetchitchio.py index 7e2a18f0df62..4d1132c4fe7f 100644 --- a/pkgs/build-support/fetchitchio/fetchitchio.py +++ b/pkgs/build-support/fetchitchio/fetchitchio.py @@ -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):