From e6e5cacabeab0959d092aaf4957932a0b6f4b78e Mon Sep 17 00:00:00 2001 From: Jade Lovelace Date: Thu, 30 May 2024 13:41:31 -0700 Subject: shellHook: make it actually run When we changed this in I91cb6eb6668f3a8eace36ecbdb01eb367861d77b to not run in nested shells, we didn't predict that `nix develop` would do something ridiculous and append -env to things silently. `nix-shell` of course does not do this, so we need to tolerate both. Change-Id: Ibe7cf546823d7358ebc0414ecbe154e3e3194f45 --- package.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'package.nix') diff --git a/package.nix b/package.nix index 6251b28ba..283a590c1 100644 --- a/package.nix +++ b/package.nix @@ -449,7 +449,10 @@ stdenv.mkDerivation (finalAttrs: { shellHook = '' # don't re-run the hook in (other) nested nix-shells function lixShellHook() { - if [[ $name != lix-shell-env ]]; then + # n.b. how the heck does this become -env-env? well, `nix develop` does it: + # https://git.lix.systems/lix-project/lix/src/commit/7575db522e9008685c4009423398f6900a16bcce/src/nix/develop.cc#L240-L241 + # this is, of course, absurd. + if [[ $name != lix-shell-env && $name != lix-shell-env-env ]]; then return; fi -- cgit v1.2.3