From 395a70b7591d7287cdd1658eec3ce8ffb3e3f1d6 Mon Sep 17 00:00:00 2001 From: Martin Pander Date: Mon, 23 Feb 2026 21:45:13 +0100 Subject: [PATCH] Initial commit --- cpp/.gitignore | 77 +++++++++++++ cpp/flake.nix | 52 +++++++++ go/.gitignore | 29 +++++ go/flake.nix | 54 +++++++++ python/.gitignore | 199 ++++++++++++++++++++++++++++++++++ python/flake.lock | 61 +++++++++++ python/flake.nix | 49 +++++++++ python/pyproject.toml | 34 ++++++ python/src/my_app/__init__.py | 0 python/src/my_app/main.py | 5 + 10 files changed, 560 insertions(+) create mode 100644 cpp/.gitignore create mode 100644 cpp/flake.nix create mode 100644 go/.gitignore create mode 100644 go/flake.nix create mode 100644 python/.gitignore create mode 100644 python/flake.lock create mode 100644 python/flake.nix create mode 100644 python/pyproject.toml create mode 100644 python/src/my_app/__init__.py create mode 100644 python/src/my_app/main.py diff --git a/cpp/.gitignore b/cpp/.gitignore new file mode 100644 index 0000000..16e44c4 --- /dev/null +++ b/cpp/.gitignore @@ -0,0 +1,77 @@ +# Prerequisites +*.d + +# Compiled Object files +*.slo +*.lo +*.o +*.obj + +# Precompiled Headers +*.gch +*.pch + +# Linker files +*.ilk + +# Debugger Files +*.pdb + +# Compiled Dynamic libraries +*.so +*.dylib +*.dll +*.so.* + + +# Fortran module files +*.mod +*.smod + +# Compiled Static libraries +*.lai +*.la +*.a +*.lib + +# Executables +*.exe +*.out +*.app + +# Build directories +build/ +Build/ +build-*/ + +# CMake generated files +CMakeLists.txt.user +CMakeCache.txt +CMakeFiles +CMakeScripts +Testing +Makefile +cmake_install.cmake +install_manifest.txt +compile_commands.json +CTestTestfile.cmake +_deps +CMakeUserPresets.json + + +# Temporary files +*.tmp +*.log +*.bak +*.swp + +# vcpkg +vcpkg_installed/ + +# debug information files +*.dwo + +# test output & cache +Testing/ +.cache/ + diff --git a/cpp/flake.nix b/cpp/flake.nix new file mode 100644 index 0000000..cdf2952 --- /dev/null +++ b/cpp/flake.nix @@ -0,0 +1,52 @@ +{ + description = "A C++ project flake"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + flake-parts.url = "github:hercules-ci/flake-parts"; + }; + + outputs = inputs@{ self, nixpkgs, flake-parts, ... }: + flake-parts.lib.mkFlake { inherit inputs; } { + systems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ]; + + perSystem = { config, self', inputs', pkgs, system, ... }: { + packages.default = pkgs.stdenv.mkDerivation { + pname = "my-cpp-app"; + version = "0.1.0"; + src = ./.; + + # Build-time dependencies (compilers, build systems) + nativeBuildInputs = with pkgs; [ + cmake + ninja + pkg-config + ]; + + # Runtime dependencies (libraries your code links against) + buildInputs = with pkgs; [ + # boost + # fmt + ]; + + # Optional: Configure CMake flags + cmakeFlags = [ + "-DCMAKE_BUILD_TYPE=Release" + ]; + }; + + devShells.default = pkgs.mkShell { + inputsFrom = [ self'.packages.default ]; + + packages = with pkgs; [ + gdb + clang-tools # Includes clang-format and clangd (LSP) + valgrind + ]; + + shellHook = '' + ''; + }; + }; + }; +} diff --git a/go/.gitignore b/go/.gitignore new file mode 100644 index 0000000..6679a1e --- /dev/null +++ b/go/.gitignore @@ -0,0 +1,29 @@ +# Binaries for programs and plugins +*.exe +*.exe~ +*.dll +*.so +*.dylib + +# Test binary, built with `go test -c` +*.test + +# Code coverage profiles and other test artifacts +*.out +coverage.* +*.coverprofile +profile.cov + +# Dependency directories (remove the comment below to include it) +# vendor/ + +# Go workspace file +go.work +go.work.sum + +# env file +.env + +# Editor/IDE +# .idea/ +# .vscode/ diff --git a/go/flake.nix b/go/flake.nix new file mode 100644 index 0000000..f8252df --- /dev/null +++ b/go/flake.nix @@ -0,0 +1,54 @@ +{ + description = "Go Project"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + flake-parts.url = "github:hercules-ci/flake-parts"; + }; + + outputs = inputs@{ self, nixpkgs, flake-parts, ... }: + flake-parts.lib.mkFlake { inherit inputs; } { + systems = [ "x86_64-linux" "aarch64-linux" "aarch64-darwin" "x86_64-darwin" ]; + + perSystem = { config, self', inputs', pkgs, system, ... }: { + packages.my-app = pkgs.buildGoModule { + pname = "My App"; + version = "0.1.0"; + src = ./.; + + vendorHash = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"; + + #ldflags = [ "-s" "-w" ]; + + nativeBuildInputs = with pkgs; [ + ]; + + meta = with pkgs.lib; { + description = "A Go Application"; + mainProgram = "main"; + }; + }; + + # Set the default package + packages.default = self'.packages.my-app; + + # Development shell + devShells.default = pkgs.mkShell { + + inputsFrom = [ self'.packages.my-app ]; + + buildInputs = with pkgs; [ + go_1_25 + gotools + golangci-lint + gopls + go-outline + gopkgs + go-tools + gotests + delve + ]; + }; + }; + }; +} diff --git a/python/.gitignore b/python/.gitignore new file mode 100644 index 0000000..711ef7c --- /dev/null +++ b/python/.gitignore @@ -0,0 +1,199 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[codz] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST +result + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py.cover +.hypothesis/ +.pytest_cache/ +cover/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 +db.sqlite3-journal + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +.pybuilder/ +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +# For a library or package, you might want to ignore these files since the code is +# intended to run in multiple environments; otherwise, check them in: +# .python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +# Pipfile.lock + +# UV +# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control. +# This is especially recommended for binary packages to ensure reproducibility, and is more +# commonly ignored for libraries. +# uv.lock + +# poetry +# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. +# This is especially recommended for binary packages to ensure reproducibility, and is more +# commonly ignored for libraries. +# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control +# poetry.lock +# poetry.toml + +# pdm +# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. +# pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python. +# https://pdm-project.org/en/latest/usage/project/#working-with-version-control +# pdm.lock +# pdm.toml +.pdm-python +.pdm-build/ + +# pixi +# Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control. +# pixi.lock +# Pixi creates a virtual environment in the .pixi directory, just like venv module creates one +# in the .venv directory. It is recommended not to include this directory in version control. +.pixi + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm +__pypackages__/ + +# Celery stuff +celerybeat-schedule +celerybeat.pid + +# Redis +*.rdb +*.aof +*.pid + +# RabbitMQ +mnesia/ +rabbitmq/ +rabbitmq-data/ + +# ActiveMQ +activemq-data/ + +# SageMath parsed files +*.sage.py + +# Environments +.env +.envrc +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ + +# pytype static type analyzer +.pytype/ + +# Cython debug symbols +cython_debug/ + +# .vscode/ + +# Ruff stuff: +.ruff_cache/ + +# PyPI configuration file +.pypirc + +# Marimo +marimo/_static/ +marimo/_lsp/ +__marimo__/ + +# Streamlit +.streamlit/secrets.toml diff --git a/python/flake.lock b/python/flake.lock new file mode 100644 index 0000000..7225bec --- /dev/null +++ b/python/flake.lock @@ -0,0 +1,61 @@ +{ + "nodes": { + "flake-parts": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1769996383, + "narHash": "sha256-AnYjnFWgS49RlqX7LrC4uA+sCCDBj0Ry/WOJ5XWAsa0=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "57928607ea566b5db3ad13af0e57e921e6b12381", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1771369470, + "narHash": "sha256-0NBlEBKkN3lufyvFegY4TYv5mCNHbi5OmBDrzihbBMQ=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "0182a361324364ae3f436a63005877674cf45efb", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-lib": { + "locked": { + "lastModified": 1769909678, + "narHash": "sha256-cBEymOf4/o3FD5AZnzC3J9hLbiZ+QDT/KDuyHXVJOpM=", + "owner": "nix-community", + "repo": "nixpkgs.lib", + "rev": "72716169fe93074c333e8d0173151350670b824c", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixpkgs.lib", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-parts": "flake-parts", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/python/flake.nix b/python/flake.nix new file mode 100644 index 0000000..ddaf0d9 --- /dev/null +++ b/python/flake.nix @@ -0,0 +1,49 @@ +{ + description = "Python project flake"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + flake-parts.url = "github:hercules-ci/flake-parts"; + }; + + outputs = inputs@{ self, nixpkgs, flake-parts, ... }: + flake-parts.lib.mkFlake { inherit inputs; } { + systems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ]; + + perSystem = { config, self', inputs', pkgs, system, ... }: + let + python = pkgs.python314; + in + { + packages.default = python.pkgs.buildPythonApplication { + pname = "my-app"; + version = "0.1.0"; + src = ./.; + format = "pyproject"; + + nativeBuildInputs = [ + python.pkgs.hatchling + ]; + + propagatedBuildInputs = with python.pkgs; [ + # Add runtime dependencies here (e.g., requests, pandas) + ]; + + pythonImportsCheck = [ "my_app" ]; # Good practice to verify installs + }; + + devShells.default = pkgs.mkShell { + inputsFrom = [ self'.packages.default ]; + + packages = [ + pkgs.ruff # Linter/Formatter + pkgs.pyright # Type checker (replaced 'ty') + ]; + + shellHook = '' + export PYTHONPATH="$PYTHONPATH:$(pwd)" + ''; + }; + }; + }; +} diff --git a/python/pyproject.toml b/python/pyproject.toml new file mode 100644 index 0000000..20c5d78 --- /dev/null +++ b/python/pyproject.toml @@ -0,0 +1,34 @@ +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[project] +name = "my-app" +version = "0.1.0" +description = "Python development environment" +requires-python = ">=3.11" +#readme = "README.md" +#license = {text = "MIT"} +# authors = [ +# {name = "Martin Pander", email = "martin.pander@knowtion.de"}, +# ] +dependencies = [ +] + +[project.scripts] +my-app = "my_app.main:main" + +[tool.hatch.build.targets.wheel] +packages = ["src/my_app"] + +[tool.hatch.build.targets.sdist] +include = ["src"] + +[tool.ruff] +line-length = 100 +target-version = "py311" + +[tool.ruff.lint] +select = ["E", "F", "I"] # Error, Pyflakes, Isort +dependencies = [] + diff --git a/python/src/my_app/__init__.py b/python/src/my_app/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/python/src/my_app/main.py b/python/src/my_app/main.py new file mode 100644 index 0000000..4d20c6e --- /dev/null +++ b/python/src/my_app/main.py @@ -0,0 +1,5 @@ +def main(): + print("Hello!") + +if __name__=="__main__": + main()