Skip to content

Commit 0938db7

Browse files
committed
Update nix documentation after refactor to flake
1 parent c0de3c0 commit 0938db7

File tree

1 file changed

+16
-13
lines changed

1 file changed

+16
-13
lines changed

template/docs/{% if nix %}nix.rst{% endif %}.jinja

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,31 +8,34 @@ Prerequisites:
88

99
* Nix 2.8.x or later installed `(How to install Nix) <https://nixos.org/download.html>`__
1010

11-
First configure Nix channel if needed:
11+
First `enable Nix flakes <https://nixos.wiki/wiki/Flakes#Enable_flakes>`__ if needed.
12+
13+
Optionally `setup fastapi-mvc Nix binary cache <https://app.cachix.org/cache/fastapi-mvc#pull>`__ to speed up the build process:
1214

1315
.. code-block:: bash
1416

15-
nix-channel --add https://nixos.org/channels/nixos-22.05
16-
nix-channel --update
17+
nix-env -iA cachix -f https://cachix.org/api/v1/install
18+
cachix use fastapi-mvc
1719

18-
Next install make via Nix:
20+
To build default package run:
1921

2022
.. code-block:: bash
2123

22-
nix-env --install gnumake
23-
# If you do not want to install make to your profile, one can always use it ad-hoc via nix-shell
24-
nix-shell -p gnumake
24+
nix build .#default
2525

26-
Lastly, use ``make install`` target:
26+
Or with concrete Python version, should you choose:
2727

2828
.. code-block:: bash
2929

30-
make install
31-
# Or
32-
nix-shell -p gnumake --run "make install"
30+
# Build with Python38
31+
nix build .#{{project_name}}-py38
32+
# Build with Python39
33+
nix build .#{{project_name}}-py39
34+
# Build with Python310
35+
nix build .#{{project_name}}-py310
3336

34-
Or using Nix directly, should you choose:
37+
Lastly, to spawn shell for development environment run:
3538

3639
.. code-block:: bash
3740

38-
nix-build -E 'with import <nixpkgs> { overlays = [ (import ./overlay.nix) ]; }; callPackage ./editable.nix {python = pkgs.python310; poetry2nix = pkgs.poetry2nix;}'
41+
nix develop .#default

0 commit comments

Comments
 (0)