Create Basic Templates
This commit is contained in:
17
flake.nix
Normal file
17
flake.nix
Normal 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
17
flakes/basic/flake.nix
Normal 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
31
flakes/python/flake.nix
Normal 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
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
});
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user