add `templates.python-data`

for more info, see
<https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-flake-init.html>
This commit is contained in:
colin 2022-11-30 00:48:27 +00:00
parent 2f45c57310
commit 0253774622
2 changed files with 33 additions and 0 deletions

View File

@ -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";
};
};
};
}

View File

@ -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 ];
};
}
);
}