From e3ed0fc2e3835cc5c635fde2ed9c2bdaf9da3bef Mon Sep 17 00:00:00 2001 From: Vova Kot Date: Sat, 10 Oct 2026 17:35:11 +0000 Subject: [PATCH] fix: check for nix flake support before trying to load flake --- .envrc | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.envrc b/.envrc index 6a0e44f6e1876..86c6aee16f1c5 100644 --- a/.envrc +++ b/.envrc @@ -1,5 +1,14 @@ source_up_if_exists -if command -v nix >/dev/null 2>&1; then - use flake + +if has nix; then + if nix --extra-experimental-features "nix-command flakes" flake --help >/dev/null 2>&1; then + use flake + else + nix_description=$( + nix --version 2>/dev/null || printf "Nix with an unknown version" + ) + log_status "WARNING: Detected $nix_description, which does not support flakes; skipping the flake-based development environment" + fi fi + source_env_if_exists .envrc.local