repo: init

welcome 👋 to my world 🌍
This commit is contained in:
Artur Manuel 2024-08-11 08:22:48 +01:00
commit edcf6f758e
Failed to generate hash of commit
11 changed files with 134 additions and 2 deletions

1
templates/python/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
**/result

1
templates/python/README Normal file
View file

@ -0,0 +1 @@
remember to change python-app to whatever you please!

27
templates/python/flake.lock generated Normal file
View file

@ -0,0 +1,27 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1722987190,
"narHash": "sha256-68hmex5efCiM2aZlAAEcQgmFI4ZwWt8a80vOeB/5w3A=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "21cc704b5e918c5fbf4f9fff22b4ac2681706d90",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-24.05",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

View file

@ -0,0 +1,26 @@
{
description = "Python flake";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
};
outputs = { self, nixpkgs }:
let
systems = [ "x86_64-linux" "aarch64-linux" ];
forAllSystems = nixpkgs.lib.genAttrs systems;
pkgsForEach = nixpkgs.legacyPackages;
in
{
packages = forAllSystems (system: {
default = pkgsForEach.${system}.callPackage ./nix/package.nix { };
python-app = self.packages.${system}.default;
});
devShells = forAllSystems (system: {
default = pkgsForEach.${system}.callPackage ./nix/shell.nix {
inherit (self.packages.${system}) python-app;
};
});
};
}

View file

@ -0,0 +1,16 @@
{ python3Packages }:
let
pname = "python-app";
version = "0.1.0";
inherit (python3Packages)
buildPythonApplication
flask
;
in
buildPythonApplication {
inherit pname version;
propagatedBuildInputs = [
flask
];
src = ../${pname};
}

View file

@ -0,0 +1,8 @@
{ mkShell, python-app, python312Packages }:
mkShell {
inputsFrom = [ python-app ];
nativeBuildInputs = [
python312Packages.ruff-lsp
python312Packages.ruff
];
}

View file

@ -0,0 +1,11 @@
#!/usr/bin/env python
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello_world():
return 'Hello, World!'
if __name__ == '__main__':
app.run(host="0.0.0.0", port=8080)

View file

@ -0,0 +1,11 @@
#!/usr/bin/env python
from setuptools import setup, find_packages
setup(name='python-app',
version='0.1.0',
# Modules to import from other scripts:
packages=find_packages(),
# Executables
scripts=["python-app"],
)