devShell: add python environment explicitly (for VS Code)

This commit is contained in:
Alexander Tomokhov 2023-11-22 09:37:49 +04:00
parent 22f9d2e9df
commit b3a6e6393c
2 changed files with 17 additions and 13 deletions

View file

@ -27,8 +27,4 @@ pythonPackages.buildPythonApplication rec {
SelfPrivacy Server Management API SelfPrivacy Server Management API
''; '';
}; };
passthru = {
# TODO explain what's the purpose of this?
pythonPath = pythonPackages.makePythonPath propagatedBuildInputs;
};
} }

View file

@ -20,15 +20,23 @@
]; ];
}; };
devShells.${system}.default = pkgs.mkShell { devShells.${system}.default = pkgs.mkShell {
inputsFrom = [ selfprivacy-graphql-api ]; packages =
packages = with pkgs; [ let
black # TODO is there a better way to get environment for VS Code?
rclone python3 =
redis nixpkgs.lib.findFirst (p: p.pname == "python3") (abort "wtf")
restic self.packages.${system}.default.propagatedBuildInputs;
]; python-env =
# FIXME is it still needed inside shellHook? python3.withPackages
# PYTHONPATH=${sp-python}/${sp-python.sitePackages} (_: self.packages.${system}.default.propagatedBuildInputs);
in
with pkgs; [
python-env
black
rclone
redis
restic
];
shellHook = '' shellHook = ''
# envs set with export and as attributes are treated differently. # envs set with export and as attributes are treated differently.
# for example. printenv <Name> will not fetch the value of an attribute. # for example. printenv <Name> will not fetch the value of an attribute.