fsagbuya I tried the nix develop
with devShells
and now it seems everything works as expected. I can call python 3.9.16
there and import my local installed python packages i.e. pandas, matplotlib, influxdb etc.
In the flake.nix
file, I changed the line defaultPackage.x86_64-linux = pkgs.buildEnv {
to devShells.x86_64-linux.default = pkgs.mkShell {
and then paths = [
to packages = [
. This seems working fine.
Here is the modified flake.nix
file in case anyone else needs it for reference:
{
inputs.artiq.url = "git+https://github.com/m-labs/artiq.git?ref=release-7";
inputs.extrapkg.url = "git+https://git.m-labs.hk/M-Labs/artiq-extrapkg.git?ref=release-7";
inputs.extrapkg.inputs.artiq.follows = "artiq";
outputs = { self, artiq, extrapkg }:
let
pkgs = artiq.inputs.nixpkgs.legacyPackages.x86_64-linux;
aqmain = artiq.packages.x86_64-linux;
aqextra = extrapkg.packages.x86_64-linux;
in {
#defaultPackage.x86_64-linux = pkgs.buildEnv {
devShells.x86_64-linux.default = pkgs.mkShell {
name = "artiq-env";
#paths = [
packages = [
# ========================================
# EDIT BELOW
# ========================================
(pkgs.python3.withPackages(ps: [
# List desired Python packages here.
aqmain.artiq
#ps.paramiko # needed if and only if flashing boards remotely (artiq_flash -H)
#aqextra.flake8-artiq
# The NixOS package collection contains many other packages that you may find
# interesting. Here are some examples:
ps.pandas
#ps.numpy
#ps.scipy
# or if you need Qt (will recompile):
#(ps.matplotlib.override { enableQt = true; })
#ps.bokeh
#ps.cirq
#ps.qiskit
]))
#aqextra.korad_ka3005p
#aqextra.novatech409b
# List desired non-Python packages here
#aqmain.openocd-bscanspi # needed if and only if flashing boards
# Other potentially interesting packages from the NixOS package collection:
#pkgs.gtkwave
#pkgs.spyder
#pkgs.R
#pkgs.julia
# ========================================
# EDIT ABOVE
# ========================================
];
};
};
nixConfig = { # work around https://github.com/NixOS/nix/issues/6771
extra-trusted-public-keys = "nixbld.m-labs.hk-1:5aSRVA5b320xbNvu30tqxVPXpld73bhtOeH6uAjRyHc=";
extra-substituters = "https://nixbld.m-labs.hk";
};
}
Thanks a lot for your help!!