mirror of
https://github.com/nmasur/dotfiles
synced 2024-11-24 17:55:37 +00:00
add template for python requirements.txt projects
This commit is contained in:
parent
e4b15ea100
commit
720ca5d94c
@ -93,6 +93,10 @@
|
||||
path = ./templates/poetry;
|
||||
description = "Poetry template";
|
||||
};
|
||||
python = {
|
||||
path = ./templates/python;
|
||||
description = "Legacy Python template";
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
|
1
templates/python/.envrc
Normal file
1
templates/python/.envrc
Normal file
@ -0,0 +1 @@
|
||||
use flake . --no-use-registries
|
4
templates/python/.gitignore
vendored
Normal file
4
templates/python/.gitignore
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
.direnv
|
||||
result
|
||||
*.pyc
|
||||
.DS_Store
|
42
templates/python/flake.lock
Normal file
42
templates/python/flake.lock
Normal file
@ -0,0 +1,42 @@
|
||||
{
|
||||
"nodes": {
|
||||
"flake-utils": {
|
||||
"locked": {
|
||||
"lastModified": 1653893745,
|
||||
"narHash": "sha256-0jntwV3Z8//YwuOjzhV2sgJJPt+HY6KhU7VZUL0fKZQ=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "1ed9fb1935d260de5fe1c2f7ee0ebaae17ed2fa1",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1655779787,
|
||||
"narHash": "sha256-Z5VL2AANN3Rk92xFs/3pPVyDQVTIcmNAIeTQNFOJnNE=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "ce83dc760cd3428ce9938aa711a0c7c81f55c567",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"flake-utils": "flake-utils",
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
20
templates/python/flake.nix
Normal file
20
templates/python/flake.nix
Normal file
@ -0,0 +1,20 @@
|
||||
{
|
||||
description = "Python pip flake";
|
||||
|
||||
inputs.flake-utils.url = "github:numtide/flake-utils";
|
||||
inputs.nixpkgs.url = "github:NixOS/nixpkgs";
|
||||
|
||||
outputs = { self, nixpkgs, flake-utils }:
|
||||
flake-utils.lib.eachDefaultSystem (system:
|
||||
let
|
||||
pkgs = import nixpkgs { inherit system; };
|
||||
pythonEnv = pkgs.python310.withPackages (pypi:
|
||||
with pypi;
|
||||
[
|
||||
# Add requirements here
|
||||
requests
|
||||
]);
|
||||
in {
|
||||
devShells.default = pkgs.mkShell { buildInputs = [ pythonEnv ]; };
|
||||
});
|
||||
}
|
Loading…
Reference in New Issue
Block a user