From 992b88b87d17c6bd801d76159f4bdb0ec80d1d9b Mon Sep 17 00:00:00 2001 From: Bryan Bennett Date: Fri, 31 May 2024 07:59:12 -0400 Subject: [PATCH 1/2] Set IN_NIX_SHELL explicitly in use_nix --- direnvrc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/direnvrc b/direnvrc index 5bfeb85..f7282a2 100644 --- a/direnvrc +++ b/direnvrc @@ -467,6 +467,11 @@ use_nix() { fi fi + # Some builtin nix tooling depends on this variable being set BEFORE their invocation to change their behavior + # (notably haskellPackages.developPackage returns an env if this is set) + # This allows us to more closely mimic nix-shell. + export IN_NIX_SHELL="impure" + if tmp_profile_rc=$(_nix \ print-dev-env \ --profile "$tmp_profile" \ From 54add2fba2e2a0817c9ff1f20750f4ff89a346df Mon Sep 17 00:00:00 2001 From: Bryan Bennett Date: Fri, 31 May 2024 07:59:43 -0400 Subject: [PATCH 2/2] Set sh-mode explicitly for emacs users --- direnvrc | 1 + 1 file changed, 1 insertion(+) diff --git a/direnvrc b/direnvrc index f7282a2..b57953f 100644 --- a/direnvrc +++ b/direnvrc @@ -1,3 +1,4 @@ +# -*- mode: sh -*- # shellcheck shell=bash NIX_DIRENV_VERSION=3.0.4