[python] docs: Update conda usage
This commit is contained in:
parent
4245f7cac3
commit
1e9cc62985
2 changed files with 26 additions and 22 deletions
|
@ -5,11 +5,11 @@
|
|||
"systems": "systems"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1694529238,
|
||||
"narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=",
|
||||
"lastModified": 1710146030,
|
||||
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "ff7b65b44d01cf9ba6a71320833626af21126384",
|
||||
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -20,11 +20,11 @@
|
|||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1695360818,
|
||||
"narHash": "sha256-JlkN3R/SSoMTa+CasbxS1gq+GpGxXQlNZRUh9+LIy/0=",
|
||||
"lastModified": 1712608508,
|
||||
"narHash": "sha256-vMZ5603yU0wxgyQeHJryOI+O61yrX2AHwY6LOFyV1gM=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "e35dcc04a3853da485a396bdd332217d0ac9054f",
|
||||
"rev": "4cba8b53da471aea2ab2b0c1f30a81e7c451f4b6",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
|
@ -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…
Reference in a new issue