mirror of
https://codeberg.org/mhwombat/nix-book.git
synced 2025-12-28 09:15:03 +08:00
24 lines
321 B
Text
24 lines
321 B
Text
= In `shell.nix`
|
|
|
|
[source,nix,linenums]
|
|
.shell.nix
|
|
....
|
|
include::shell.nix[]
|
|
....
|
|
|
|
Here's a short Python program that uses it.
|
|
|
|
[source,python,linenums]
|
|
.Main.hs
|
|
....
|
|
include::Main.py[]
|
|
....
|
|
|
|
Here's a demonstration using the program.
|
|
|
|
....
|
|
$# echo '$ nix-shell'
|
|
$# nix-shell --run bash <<EOL
|
|
$ python Main.py
|
|
$# EOL
|
|
....
|