flakes/python/conda/flake.nix

47 lines
1.3 KiB
Nix

{
description = ''
Python flake for use with conda environments.
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, install conda and set up your environment using
$ nix develop -c bash -c "conda-shell -c 'conda-install'"
$ nix develop -c bash -c "conda-shell -c 'conda-env create --name <environment-name> --file /path/to/environment.yaml'"
'';
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;
};
in {
devShells.default = pkgs.mkShell {
packages = with pkgs; [
conda
# You might want to add an IDE of your choice;
(jetbrains.plugins.addPlugins jetbrains.pycharm-professional [ "github-copilot" ])
];
};
});
}