I am trying to run a shell.nix file very close to the one shown below. I have setup.py file in my python package but even inside nix-shell the live changes in my code are reflected in the my installed version of mypkg. Could someone please help avoid rebuilding and get a development shell for mypkg.
{
sources ? import ./nix/sources.nix
, pkgs ? import sources.nixpkgs { config = { allowUnfree = true; }; }
}:
let
mach-nix = import (builtins.fetchGit {
url = "https://github.com/DavHau/mach-nix/";
ref = "refs/tags/3.1.1";
}) { pkgs = pkgs; python = "python37"; };
mypkg = pkgs.python37Packages.buildPythonPackage rec {
name = "mypkg";
src = ./.;
propagatedBuildInputs = [ pythonPkgsWithMach ];
doCheck = false;
};
pythonPkgsWithMach = mach-nix.mkPython rec {
requirements = ''
click
cython
pytest
pytest-runner
ipython
numpy
pandas
matplotlib
hvplot
datashader
jupyterlab
scipy
'';
providers = {
click="nixpkgs,wheel";
};
};
in
pkgs.stdenv.mkDerivation rec {
name = "mypkg-dev";
buildInputs = [
pythonPkgsWithMach
mypkg
];
shellHook = ''
export ENVNAME=${name}
'';
}