diff --git a/doc/manual/building_developing.rst b/doc/manual/building_developing.rst index 9bfec655a..e196c689d 100644 --- a/doc/manual/building_developing.rst +++ b/doc/manual/building_developing.rst @@ -82,11 +82,31 @@ Nix development environment --------------------------- * Install `Nix `_ if you haven't already. Prefer a single-user installation for simplicity. -* Enable flakes in Nix, for example by adding ``experimental-features = nix-command flakes`` to ``nix.conf``; see the `NixOS Wiki on flakes `_ for details and more options. +* Configure Nix to support building ARTIQ: + + - Enable flakes, for example by adding ``experimental-features = nix-command flakes`` to ``nix.conf``. See also the `NixOS Wiki on flakes `_. + - Add ``/opt`` (or your Vivado location) as an Nix sandbox, for example by adding ``extra-sandbox-paths = /opt`` to ``nix.conf``. + - Create a file called ``trusted-settings.json`` in ``~/.local/share/nix/``, if it doesn't exist already. Make sure it contains the following: + + :: + + { + "extra-sandbox-paths":{ + "/opt":true + }, + "extra-substituters":{ + "https://nixbld.m-labs.hk":true + }, + "extra-trusted-public-keys":{ + "nixbld.m-labs.hk-1:5aSRVA5b320xbNvu30tqxVPXpld73bhtOeH6uAjRyHc=":true + } + } + + - If using NixOS, instead make the equivalent changes to your ``configuration.nix``. + * Clone `the ARTIQ Git repository `_, or `the ARTIQ-Zynq repository `__ for Zynq devices (Kasli-SoC or ZC706). By default, you are working with the ``master`` branch, which represents the beta version and is not stable (see :doc:`releases`). Checkout the most recent release (``git checkout release-[number]``) for a stable version. * If your Vivado installation is not in its default location ``/opt``, open ``flake.nix`` and edit it accordingly (note that the edits must be made in the main ARTIQ flake, even if you are working with Zynq, see also tip below). * Run ``nix develop`` at the root of the repository, where ``flake.nix`` is. -* Answer ``y``/'yes' to any Nix configuration questions if necessary, as in :ref:`installing-troubleshooting`. .. note:: You can also target legacy versions of ARTIQ; use Git to checkout older release branches. Note however that older releases of ARTIQ required different processes for developing and building, which you are broadly more likely to figure out by (also) consulting the corresponding older versions of the manual. @@ -228,9 +248,6 @@ For ZC706: where ``fw-type`` is ``runtime`` for standalone or DRTIO master builds and ``satman`` for DRTIO satellites. Both the gateware and the firmware will generate into the ``../build`` destination directory. At this stage you can :ref:`boot from JTAG `; either of the ``*_run.sh`` scripts will expect the gateware and firmware files at their default locations, and the ``szl.elf`` bootloader is retrieved automatically. -.. warning:: - Note that in between runs of ``make`` it is necessary to manually clear ``build``, even for different targets, or ``make`` will do nothing. - If you prefer to boot from SD card, you will need to construct your own ``boot.bin``. Build ``szl.elf`` from source by running a command of the form: :: $ nix build git+https://git.m-labs.hk/m-labs/zynq-rs#-szl diff --git a/doc/manual/installing.rst b/doc/manual/installing.rst index e3655138b..e558ce3e5 100644 --- a/doc/manual/installing.rst +++ b/doc/manual/installing.rst @@ -97,7 +97,7 @@ To find more packages you can browse the `Nix package search