Skip to content

Commit

Permalink
pkgs/nix-direnv: Use explicit paths to nixpkgs utils.
Browse files Browse the repository at this point in the history
We need to make sure that nix-direnv is explicitly using utils from
nixpkgs, since the operating system versions of the utils may not play
nicely (e.g. BSD-grep on macOS won't work w/ nix-direnv).

See also: nix-community/nix-direnv#3
  • Loading branch information
tviti committed Mar 25, 2020
1 parent 08931ae commit 264397a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions pkgs/nix-direnv/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ fetchFromGitHub, stdenv }:
{ bash, fetchFromGitHub, gnugrep, stdenv }:

stdenv.mkDerivation {
name = "nix-direnv";
Expand All @@ -10,8 +10,13 @@ stdenv.mkDerivation {
sha256 = "067493hbsij59bvaqi38iybacqbzwx876dvdm651b5mn3zs3h42c";
};

phases = [ "unpackPhase" "installPhase" ];
phases = [ "unpackPhase" "patchPhase" "installPhase" ];

prePatch = ''
substituteInPlace direnvrc --replace "/usr/bin/env bash" "${bash}/bin/bash"
substituteInPlace direnvrc --replace "grep" "${gnugrep}/bin/grep"
'';

installPhase = ''
mkdir -p $out/share/nix-direnv
cp -rv ./* $out/share/nix-direnv
Expand Down

0 comments on commit 264397a

Please sign in to comment.