From b178d9ed70c7b7ba0f66deaea85116276b6106f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Thu, 5 May 2022 21:05:19 +0200 Subject: [PATCH] nix-env: allow non-linux packages --- ci/nur/index.py | 5 ++++- ci/nur/update.py | 5 ++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/ci/nur/index.py b/ci/nur/index.py index 3ed20dc4d..8237589a1 100644 --- a/ci/nur/index.py +++ b/ci/nur/index.py @@ -1,6 +1,7 @@ import json import subprocess import sys +import os from argparse import Namespace from pathlib import Path from tempfile import NamedTemporaryFile @@ -73,9 +74,11 @@ callPackage (nur.repo-sources."%s" + "/%s") {} with NamedTemporaryFile(mode="w") as f: f.write(expr) f.flush() + env = os.environ.copy() + env.update(NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM="1") query_cmd = ["nix-env", "-qa", "*", "--json", "-f", str(f.name)] try: - out = subprocess.check_output(query_cmd) + out = subprocess.check_output(query_cmd, env=env) except subprocess.CalledProcessError: print(f"failed to evaluate {repo}", file=sys.stderr) return {} diff --git a/ci/nur/update.py b/ci/nur/update.py index 9fc9d53d4..79098144e 100644 --- a/ci/nur/update.py +++ b/ci/nur/update.py @@ -49,9 +49,8 @@ import {EVALREPO_PATH} {{ # fmt: on logger.info(f"Evaluate repository {repo.name}") - proc = subprocess.Popen( - cmd, env=dict(PATH=os.environ["PATH"]), stdout=subprocess.DEVNULL - ) + env = dict(PATH=os.environ["PATH"], NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM="1") + proc = subprocess.Popen(cmd, env=env, stdout=subprocess.DEVNULL) try: res = proc.wait(10) except subprocess.TimeoutExpired: