From 46c42e5983061b6a8dd773cb238afd05ec6f72a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Fri, 19 Nov 2021 09:28:02 +0100 Subject: [PATCH] use_flake: use ls to resolve link name --- direnvrc | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/direnvrc b/direnvrc index 81b81e2..d9581ce 100644 --- a/direnvrc +++ b/direnvrc @@ -129,12 +129,8 @@ use_flake() { tmp_profile_rc=$("${NIX_BIN_PREFIX}nix" print-dev-env \ --extra-experimental-features "nix-command flakes" \ --profile "$tmp_profile" "$flake_expr") - # macos does not have realpath - if command -v realpath >/dev/null; then - drv=$(realpath "$tmp_profile") - else - drv=$(perl -e 'use Cwd "abs_path";print abs_path(shift)' "$tmp_profile") - fi + drv=$(ls -dl "$tmp_profile") + drv=${drv#*-> } echo "$tmp_profile_rc" > "$profile_rc" rm -f "$tmp_profile" "$tmp_profile"* _nix_add_gcroot "$drv" "$profile"