From 5f6a74b01cf4594dd5de08d4accd1d1e84b66946 Mon Sep 17 00:00:00 2001 From: Ivan Trubach Date: Sun, 31 Mar 2024 19:40:44 +0300 Subject: [PATCH] Fix local flakes when prefixed with "path:" (again) This change fixes regression introduced in commit 4bf5d40290981c867d70f6d3c0d505dd03bc2c0d. In particular, we should not be passing flake URI without schema to the nix flake archive command. --- direnvrc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/direnvrc b/direnvrc index 1592a3d..ab54fcf 100644 --- a/direnvrc +++ b/direnvrc @@ -247,8 +247,8 @@ use_flake() { fi flake_expr="${1:-.}" - flake_dir="${flake_expr%#*}" - flake_dir=${flake_dir#"path:"} + flake_uri="${flake_expr%#*}" + flake_dir=${flake_uri#"path:"} if [[ $flake_expr == -* ]]; then local message="the first argument must be a flake expression" @@ -310,7 +310,7 @@ use_flake() { mkdir -p "$flake_inputs" flake_input_paths=$(_nix flake archive \ --json --no-write-lock-file \ - "$flake_dir") + -- "$flake_uri") while [[ $flake_input_paths =~ /nix/store/[^\"]+ ]]; do local store_path="${BASH_REMATCH[0]}"