nix-direnv/default.nix
2023-05-23 15:40:13 +02:00

24 lines
557 B
Nix

{ stdenv, nix, gnugrep, lib }:
stdenv.mkDerivation {
name = "nix-direnv";
src = ./.;
postPatch = ''
sed -i "2iNIX_BIN_PREFIX=${nix}/bin/" direnvrc
substituteInPlace direnvrc \
--replace "grep" "${gnugrep}/bin/grep"
'';
installPhase = ''
install -m400 -D direnvrc $out/share/nix-direnv/direnvrc
'';
meta = with lib; {
description = "A fast, persistent use_nix implementation for direnv";
homepage = "https://github.com/nix-community/nix-direnv";
license = licenses.mit;
platforms = platforms.unix;
};
}