Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drop dependency on gnugrep #415

Merged
merged 2 commits into from
Nov 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ stdenv.mkDerivation {

postPatch = ''
sed -i "2iNIX_BIN_PREFIX=${nix}/bin/" direnvrc
substituteInPlace direnvrc \
--replace "grep" "${gnugrep}/bin/grep"
'';

installPhase = ''
Expand Down
12 changes: 7 additions & 5 deletions direnvrc
Original file line number Diff line number Diff line change
Expand Up @@ -302,12 +302,14 @@ use_flake() {
local flake_input_paths
mkdir -p "$flake_inputs"
flake_input_paths=$("${NIX_BIN_PREFIX}nix" flake archive \
--json \
--json --no-write-lock-file \
--extra-experimental-features "nix-command flakes" \
--no-write-lock-file \
"$flake_dir" | grep -E -o '/nix/store/[^"]+')
for path in $flake_input_paths; do
_nix_add_gcroot "$path" "${flake_inputs}/${path##*/}"
"$flake_dir")

while [[ "$flake_input_paths" =~ /nix/store/[^\"]+ ]]; do
local store_path="${BASH_REMATCH[0]}"
_nix_add_gcroot "${store_path}" "${flake_inputs}/${store_path##*/}"
flake_input_paths="${flake_input_paths/${store_path}/}"
done

log_status "nix-direnv: renewed cache"
Expand Down