about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/misc/nix-direnv/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/tools/misc/nix-direnv/default.nix')
-rw-r--r--nixpkgs/pkgs/tools/misc/nix-direnv/default.nix18
1 files changed, 14 insertions, 4 deletions
diff --git a/nixpkgs/pkgs/tools/misc/nix-direnv/default.nix b/nixpkgs/pkgs/tools/misc/nix-direnv/default.nix
index 39fd7d3e5f0d..526efc65f6a4 100644
--- a/nixpkgs/pkgs/tools/misc/nix-direnv/default.nix
+++ b/nixpkgs/pkgs/tools/misc/nix-direnv/default.nix
@@ -1,20 +1,30 @@
-{ lib, stdenv, fetchFromGitHub, gnugrep, nix, nixFlakes }:
+{ 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.4";
+  version = "1.2.6";
 
   src = fetchFromGitHub {
     owner = "nix-community";
     repo = "nix-direnv";
     rev = version;
-    sha256 = "sha256-87x+MRQ1SjtN+wNCy42VJwlRwgQzHjNEK3J1bkvo7eQ=";
+    sha256 = "sha256-0dCIHgoyNgpxbrPDv26oLdU+npcIgpCQdpX4HzS0vN0=";
   };
 
   # Substitute instead of wrapping because the resulting file is
   # getting sourced, not executed:
   postPatch = ''
-    sed -i "1a NIX_BIN_PREFIX=${nixFlakes}/bin/" direnvrc
+    sed -i "1a NIX_BIN_PREFIX=${nix}/bin/" direnvrc
     substituteInPlace direnvrc --replace "grep" "${gnugrep}/bin/grep"
   '';