diff options
author | Jade Lovelace <lix@jade.fyi> | 2024-05-30 13:41:31 -0700 |
---|---|---|
committer | jade <lix@jade.fyi> | 2024-05-30 21:54:21 +0000 |
commit | e6e5cacabeab0959d092aaf4957932a0b6f4b78e (patch) | |
tree | 1636682e16bde54b23e1bdb3cf484da41ddf84bf | |
parent | 2f104bbe3baf1e43a3fd78dc04f3f8ed48183554 (diff) |
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
-rw-r--r-- | package.nix | 5 |
1 files changed, 4 insertions, 1 deletions
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 |