From 02537746222bd06718369aa48d081013510d79ec Mon Sep 17 00:00:00 2001 From: colin Date: Wed, 30 Nov 2022 00:48:27 +0000 Subject: [PATCH] add `templates.python-data` for more info, see --- flake.nix | 10 ++++++++++ templates/python-data/flake.nix | 23 +++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 templates/python-data/flake.nix diff --git a/flake.nix b/flake.nix index 95e22d36..ed2803e4 100644 --- a/flake.nix +++ b/flake.nix @@ -116,6 +116,16 @@ x86_64-linux = allPkgsFor "x86_64-linux"; aarch64-linux = allPkgsFor "aarch64-linux"; }; + templates = { + python-data = { + # initialize with: + # - `nix flake init -t '/home/colin/dev/nixos/#python-data'` + # then enter with: + # - `nix develop` + path = ./templates/python-data; + description = "python environment for data processing"; + }; + }; }; } diff --git a/templates/python-data/flake.nix b/templates/python-data/flake.nix new file mode 100644 index 00000000..dfdeddf0 --- /dev/null +++ b/templates/python-data/flake.nix @@ -0,0 +1,23 @@ +{ + inputs.nixpkgs.url = "nixpkgs/nixpkgs-unstable"; + inputs.flake-utils.url = github:numtide/flake-utils; + + outputs = { self, nixpkgs, flake-utils }: + with flake-utils.lib; + eachSystem allSystems (system: + let + pkgs = import nixpkgs { inherit system; }; + python-packages = pypkg: with pypkg; [ + natsort + pandas + plotly + scipy + ]; + python3 = pkgs.python3.withPackages python-packages; + in { + devShells.default = with pkgs; mkShell { + packages = [ python3 ]; + }; + } + ); +}