diff options
author | Jörg Thalheim <Mic92@users.noreply.github.com> | 2021-03-03 09:46:11 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-03 09:46:11 +0000 |
commit | 8445826ef5b2a2ee17a4f46c4fcb077332e865bb (patch) | |
tree | 55d0acb4ab78969106209bafb978221e31c2d593 | |
parent | 06e36f5275e87025a0012a6278e8bb4c6eaac1b3 (diff) | |
parent | d81d591d13df3d609b8fa05695882edce3a91244 (diff) |
Merge pull request #114622 from aaschmid/fix/nix-direnv
nix-direnv: fix NIX_BIN_PREFIX substitution in built direnvrc
-rw-r--r-- | pkgs/tools/misc/nix-direnv/default.nix | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/pkgs/tools/misc/nix-direnv/default.nix b/pkgs/tools/misc/nix-direnv/default.nix index 833f8313f6172..3fe8e3f387024 100644 --- a/pkgs/tools/misc/nix-direnv/default.nix +++ b/pkgs/tools/misc/nix-direnv/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchFromGitHub, gnugrep, nix }: +{ lib, stdenv, fetchFromGitHub, gnugrep, nix, nixFlakes }: stdenv.mkDerivation rec { pname = "nix-direnv"; @@ -14,9 +14,8 @@ stdenv.mkDerivation rec { # Substitute instead of wrapping because the resulting file is # getting sourced, not executed: postPatch = '' - substituteInPlace direnvrc \ - --replace "\''${NIX_BIN_PREFIX:-}" "\''${NIX_BIN_PREFIX:-${nix}/bin/}" \ - --replace "grep" "${gnugrep}/bin/grep" + sed -i "1a NIX_BIN_PREFIX=${nixFlakes}/bin/" direnvrc + substituteInPlace direnvrc --replace "grep" "${gnugrep}/bin/grep" ''; installPhase = '' |