From 7956ec66d7817daaeb71b11621d6492b79861510 Mon Sep 17 00:00:00 2001 From: tdpeuter Date: Mon, 25 Sep 2023 20:45:08 +0200 Subject: [PATCH] Add python conda flake --- python/conda/flake.lock | 61 +++++++++++++++++++++++++++++++++++++++++ python/conda/flake.nix | 34 +++++++++++++++++++++++ 2 files changed, 95 insertions(+) create mode 100644 python/conda/flake.lock create mode 100644 python/conda/flake.nix diff --git a/python/conda/flake.lock b/python/conda/flake.lock new file mode 100644 index 0000000..589280a --- /dev/null +++ b/python/conda/flake.lock @@ -0,0 +1,61 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1694529238, + "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1695360818, + "narHash": "sha256-JlkN3R/SSoMTa+CasbxS1gq+GpGxXQlNZRUh9+LIy/0=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "e35dcc04a3853da485a396bdd332217d0ac9054f", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/python/conda/flake.nix b/python/conda/flake.nix new file mode 100644 index 0000000..13665ad --- /dev/null +++ b/python/conda/flake.nix @@ -0,0 +1,34 @@ +{ + 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; + }; + in { + devShells.default = pkgs.mkShell { + packages = with pkgs; [ + conda + ]; + installation = '' + conda-shell -c 'conda-install' + printf 'Run `conda env create --name ai-practica --file environment.yaml` and exit. + conda-shell && exit + ''; + shellHook = '' + printf 'Enter your enviroment by running `conda activate ai-practica`.\n' + conda-shell && exit + ''; + }; + }); +}