Merge pull request #126176 from NixOS/backport-126137-to-release-21.05
[Backport release-21.05] nix-direnv: make flakes support optional and off by default
This commit is contained in:
commit
633ab195e9
@ -1,5 +1,15 @@
|
|||||||
{ lib, stdenv, fetchFromGitHub, gnugrep, nixUnstable }:
|
{ lib
|
||||||
|
, stdenv
|
||||||
|
, fetchFromGitHub
|
||||||
|
, gnugrep
|
||||||
|
, nixStable
|
||||||
|
, nixUnstable
|
||||||
|
, enableFlakes ? false
|
||||||
|
}:
|
||||||
|
|
||||||
|
let
|
||||||
|
nix = if enableFlakes then nixUnstable else nixStable;
|
||||||
|
in
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
pname = "nix-direnv";
|
pname = "nix-direnv";
|
||||||
version = "1.2.6";
|
version = "1.2.6";
|
||||||
@ -14,7 +24,7 @@ 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 = ''
|
||||||
sed -i "1a NIX_BIN_PREFIX=${nixUnstable}/bin/" direnvrc
|
sed -i "1a NIX_BIN_PREFIX=${nix}/bin/" direnvrc
|
||||||
substituteInPlace direnvrc --replace "grep" "${gnugrep}/bin/grep"
|
substituteInPlace direnvrc --replace "grep" "${gnugrep}/bin/grep"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user