[python] docs: Update conda usage
This commit is contained in:
parent
4245f7cac3
commit
1e9cc62985
2 changed files with 26 additions and 22 deletions
|
@ -2,8 +2,26 @@
|
|||
description = ''
|
||||
Python flake for use with conda environments.
|
||||
|
||||
This will create a directory `~/.conda`, which might be rather large,
|
||||
This will create a directory ~/.conda, which might become rather large,
|
||||
depending on your required packages.
|
||||
|
||||
### Usage: ###
|
||||
|
||||
You can enter the environment in your CLI with:
|
||||
|
||||
$ nix-develop -c bash -c "conda-shell -c 'conda activate <environment-name> && sh'"
|
||||
|
||||
If you are using Pycharm, you can start up quickly by running:
|
||||
|
||||
$ nix develop -c bash -c "conda-shell -c pycharm-professonial && exit"
|
||||
|
||||
### Setup: ###
|
||||
|
||||
On your first run, enter conda using
|
||||
|
||||
$ nix-develop -c bash -c "conda-shell -c 'conda-install'"
|
||||
(conda-shell)$ conda env create --name <environment-name> --file /path/to/environment.yaml
|
||||
|
||||
'';
|
||||
|
||||
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
|
@ -16,28 +34,14 @@
|
|||
inherit system;
|
||||
config.allowUnfree = true;
|
||||
};
|
||||
|
||||
installation-steps = ''
|
||||
conda-shell -c 'conda-install'
|
||||
printf 'Run `conda env create --name ai-practica --file environment.yaml` and exit.\n'
|
||||
conda-shell && exit
|
||||
'';
|
||||
IDE-steps = ''
|
||||
conda-shell -c pycharm-professional && exit
|
||||
'';
|
||||
CLI-steps = ''
|
||||
printf 'Enter your enviroment by running `conda activate ai-practica`.\n'
|
||||
conda-shell && exit
|
||||
'';
|
||||
in {
|
||||
devShells.default = pkgs.mkShell {
|
||||
packages = with pkgs; [
|
||||
conda
|
||||
|
||||
# You might want to add an IDE of your choice;
|
||||
jetbrains.pycharm-professional
|
||||
# (jetbrains.plugins.addPlugins jetbrains.pycharm-professional [ "github-copilot" ])
|
||||
];
|
||||
shellHook = IDE-steps;
|
||||
};
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue