flakes/python/conda/flake.nix
2023-09-27 14:49:29 +02:00

43 lines
1.1 KiB
Nix

{
description = ''
Python flake for use with conda environments.
This will create a directory `~/.conda`, which might be rather large,
depending on your required packages.
'';
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
inputs.flake-utils.url = "github:numtide/flake-utils";
outputs = { self, nixpkgs, flake-utils}:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
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
];
shellHook = IDE-steps;
};
});
}