Merge pull request #114622 from aaschmid/fix/nix-direnv

nix-direnv: fix NIX_BIN_PREFIX substitution in built direnvrc
This commit is contained in:
Jörg Thalheim 2021-03-03 09:46:11 +00:00 committed by GitHub
commit 8445826ef5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 4 deletions

View File

@ -1,4 +1,4 @@
{ lib, stdenv, fetchFromGitHub, gnugrep, nix }: { lib, stdenv, fetchFromGitHub, gnugrep, nix, nixFlakes }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "nix-direnv"; pname = "nix-direnv";
@ -14,9 +14,8 @@ stdenv.mkDerivation rec {
# Substitute instead of wrapping because the resulting file is # Substitute instead of wrapping because the resulting file is
# getting sourced, not executed: # getting sourced, not executed:
postPatch = '' postPatch = ''
substituteInPlace direnvrc \ sed -i "1a NIX_BIN_PREFIX=${nixFlakes}/bin/" direnvrc
--replace "\''${NIX_BIN_PREFIX:-}" "\''${NIX_BIN_PREFIX:-${nix}/bin/}" \ substituteInPlace direnvrc --replace "grep" "${gnugrep}/bin/grep"
--replace "grep" "${gnugrep}/bin/grep"
''; '';
installPhase = '' installPhase = ''