Nix exampleΒΆ

This is a minimal working example for including atomiq in the flake.nix (artiq stable) provided in the official artiq documentation. Note, that the only changes are in lines 3 and 4 where atomiq is imported as an input and line 19 where instead of the artiq python package atomiq is used.

To switch to the beta or old stable version of artiq, lines 2, 4 and 19 must be changed accordingly.

 1{
 2  inputs.extrapkg.url = "git+https://git.m-labs.hk/M-Labs/artiq-extrapkg.git?ref=release-8";
 3  inputs.atomiq.url = "git+https://gitlab.com/atomiq-project/atomiq.git";
 4  inputs.atomiq.inputs.artiqpkgs_stable.follows = "extrapkg/artiqpkgs";
 5  outputs = { self, extrapkg, atomiq }:
 6    let
 7      pkgs = extrapkg.pkgs;
 8      artiq = extrapkg.packages.x86_64-linux;
 9    in {
10      defaultPackage.x86_64-linux = pkgs.buildEnv {
11        name = "artiq-env";
12        paths = [
13          # ========================================
14          # EDIT BELOW
15          # ========================================
16          (pkgs.python3.withPackages(ps: [
17            # List desired Python packages here.
18            # artiq.artiq
19            atomiq.packages.x86_64-linux.atomiq_artiq_stable
20            #ps.paramiko  # needed if and only if flashing boards remotely (artiq_flash -H)
21            #artiq.flake8-artiq
22            #artiq.dax
23            #artiq.dax-applets
24
25            # The NixOS package collection contains many other packages that you may find
26            # interesting. Here are some examples:
27            #ps.pandas
28            #ps.numba
29            #ps.matplotlib
30            # or if you need Qt (will recompile):
31            #(ps.matplotlib.override { enableQt = true; })
32            #ps.bokeh
33            #ps.cirq
34            #ps.qiskit
35            # Note that NixOS also provides packages ps.numpy and ps.scipy, but it is
36            # not necessary to explicitly add these, since they are dependencies of
37            # ARTIQ and available with an ARTIQ install anyway.
38          ]))
39          #artiq.korad_ka3005p
40          #artiq.novatech409b
41          # List desired non-Python packages here
42          # Other potentially interesting non-Python packages from the NixOS package collection:
43          #pkgs.gtkwave
44          #pkgs.spyder
45          #pkgs.R
46          #pkgs.julia
47          # ========================================
48          # EDIT ABOVE
49          # ========================================
50        ];
51      };
52    };
53  nixConfig = {  # work around https://github.com/NixOS/nix/issues/6771
54    extra-trusted-public-keys = "nixbld.m-labs.hk-1:5aSRVA5b320xbNvu30tqxVPXpld73bhtOeH6uAjRyHc=";
55    extra-substituters = "https://nixbld.m-labs.hk";
56  };
57}