Commit 4d2546fc authored by Eric Rodrigues Pires's avatar Eric Rodrigues Pires
Browse files

fetchItchIo: fix SSL error and improve missing envvar message

parent e34c50af
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
{
  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;

+6 −6
Original line number Diff line number Diff line
@@ -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):