mirror of
https://codeberg.org/mhwombat/nix-book.git
synced 2025-12-27 16:54:57 +08:00
restructured repo
This commit is contained in:
parent
bea4055fc9
commit
285f60104b
22 changed files with 167 additions and 313 deletions
|
|
@ -1,4 +1,4 @@
|
|||
== A new flake from scratch (Python)
|
||||
= A new flake from scratch (Python)
|
||||
|
||||
At last we are ready to create a flake from scratch! Start with an empty
|
||||
directory and create a git repository.
|
||||
|
|
@ -9,6 +9,8 @@ $ cd hello-python
|
|||
$ git init
|
||||
....
|
||||
|
||||
== A simple Python program
|
||||
|
||||
Next, we’ll create a simple Python program.
|
||||
|
||||
////
|
||||
|
|
@ -57,6 +59,8 @@ $# nix-shell -p python3 --command sh
|
|||
$ python hello.py
|
||||
....
|
||||
|
||||
== A Python builder
|
||||
|
||||
Next, create a Python script to build the package. We’ll use Python’s
|
||||
setuptools, but you can use other build tools. For more information on
|
||||
setuptools, see the
|
||||
|
|
@ -106,6 +110,8 @@ $# python -m build > /dev/null 2>&1
|
|||
|
||||
After a lot of output messages, the build succeeds.
|
||||
|
||||
== The Nix flake
|
||||
|
||||
Now we should write `flake.nix`. We already know how to write most of
|
||||
the flake from the examples we did earlier. The two parts that will be
|
||||
different are the development shell and the package builder.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue