From d1d8a81f38f8304d5d6f2515db29f14a335a6327 Mon Sep 17 00:00:00 2001 From: Roland Dobai Date: Tue, 28 May 2024 15:49:15 +0200 Subject: [PATCH] fix(tools): Add suggestion how to install ESP-IDF on NixOS Closes https://github.com/espressif/esp-idf/issues/13806 --- tools/idf_tools.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/idf_tools.py b/tools/idf_tools.py index 4c0cfe8b68e..ac7248f30a5 100755 --- a/tools/idf_tools.py +++ b/tools/idf_tools.py @@ -2061,7 +2061,12 @@ def handle_missing_versions( """ Prints the info about missing tool to stderr if tool has no supported versions installed. """ - fatal(f'tool {tool.name} has no installed versions. Please run \'{install_cmd}\' to install it.') + msg = f'tool {tool.name} has no installed versions.' + if 'NIX_PATH' in os.environ: + fatal(f'{msg} The environment indicates that you might be using NixOS. ' + 'Please see https://nixos.wiki/wiki/ESP-IDF for how to install tools for it.') + else: + fatal(f'{msg} Please run \'{install_cmd}\' to install it.') if tool.version_in_path and tool.version_in_path not in tool.versions: info(f'An unsupported version of tool {tool_name} was found in PATH: {tool.version_in_path}. ' + prefer_system_hint, f=sys.stderr)