mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-10 00:08:07 +02:00
rl-next: Add note about shell.nix lookups
This commit is contained in:
parent
32fb127b9c
commit
a22f8b5276
1 changed files with 26 additions and 0 deletions
26
doc/manual/rl-next/nix-shell-looks-for-shell-nix.md
Normal file
26
doc/manual/rl-next/nix-shell-looks-for-shell-nix.md
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
---
|
||||||
|
synopsis: "`nix-shell <directory>` looks for `shell.nix`"
|
||||||
|
significance: significant
|
||||||
|
issues:
|
||||||
|
- 496
|
||||||
|
- 2279
|
||||||
|
- 4529
|
||||||
|
- 5431
|
||||||
|
- 11053
|
||||||
|
---
|
||||||
|
|
||||||
|
`nix-shell $x` now looks for `$x/shell.nix` when `$x` resolves to a directory.
|
||||||
|
|
||||||
|
Although this might be seen as a breaking change, its primarily interactive usage makes it a minor issue.
|
||||||
|
This adjustment addresses a commonly reported problem.
|
||||||
|
|
||||||
|
This also applies to `nix-shell` shebang scripts. Consider the following example:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
#!/usr/bin/env nix-shell
|
||||||
|
#!nix-shell -i bash
|
||||||
|
```
|
||||||
|
|
||||||
|
This will now load `shell.nix` from the script's directory, if it exists; `default.nix` otherwise.
|
||||||
|
|
||||||
|
The old behavior can be opted into by setting the option [`nix-shell-always-looks-for-shell-nix`](@docroot@/command-ref/conf-file.md#conf-nix-shell-always-looks-for-shell-nix) to `false`.
|
Loading…
Reference in a new issue