diff options
| author | Jörg Thalheim <Mic92@users.noreply.github.com> | 2021-06-08 10:20:51 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-06-08 10:20:51 +0200 |
| commit | 633ab195e912f7e29ddc49434e58cd764a84b4d8 (patch) | |
| tree | 8a43a4630d1417d1032d0584f5d888cfc559a919 | |
| parent | Merge pull request #126144 from NixOS/backport-126138-to-release-21.05 (diff) | |
| parent | nix-direnv: make flakes support optional (diff) | |
| download | nixpkgs-633ab195e912f7e29ddc49434e58cd764a84b4d8.tar.gz | |
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
| -rw-r--r-- | pkgs/tools/misc/nix-direnv/default.nix | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/pkgs/tools/misc/nix-direnv/default.nix b/pkgs/tools/misc/nix-direnv/default.nix index 94ce54a2a9ac..526efc65f6a4 100644 --- a/pkgs/tools/misc/nix-direnv/default.nix +++ b/pkgs/tools/misc/nix-direnv/default.nix @@ -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 { pname = "nix-direnv"; version = "1.2.6"; @@ -14,7 +24,7 @@ stdenv.mkDerivation rec { # Substitute instead of wrapping because the resulting file is # getting sourced, not executed: 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" ''; |
