Create Basic Templates

This commit is contained in:
2023-08-14 15:57:00 -04:00
parent 666b20bcb9
commit 11e3bb4a47
3 changed files with 65 additions and 0 deletions

17
flake.nix Normal file
View File

@@ -0,0 +1,17 @@
{
outputs = { self, ... }: {
templates = let
t = path: description: {
inherit path description;
};
basic = t ./flakes/basic ''
Basic Nix Flake Template
'';
in {
python = t ./flakes/python ''
Basic Python Environment Template
'';
default = basic;
};
};
}

17
flakes/basic/flake.nix Normal file
View File

@@ -0,0 +1,17 @@
{
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 = nixpkgs.legacyPackages.${system};
in {
devShells = {
default = pkgs.mkShell {
packages = with pkgs; [
];
};
};
});
}

31
flakes/python/flake.nix Normal file
View File

@@ -0,0 +1,31 @@
{
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 = nixpkgs.legacyPackages.${system};
py3 = pkgs.python3;
pyenv = py3.withPackages (p: with p; [
# Common Libraries
numpy
scipy
matplotlib
pandas
tqdm
# Development Niceties
ipython
python-lsp-server
]);
in {
devShells = {
default = pkgs.mkShell {
packages = with pkgs; [
pyenv
];
};
};
});
}