refactor: remove redundant .gitconfig tmpfiles rule, use GIT_INIT_DEFAULT_BRANCH env var

The .gitconfig at /home/hermes/.gitconfig was never read because the
hermes-agent service sets HOME=/var/lib/hermes. Git identity was already
fully covered by GIT_AUTHOR_* and GIT_COMMITTER_* env vars via .env.

Replace the dead .gitconfig's init.defaultBranch with the env var
GIT_INIT_DEFAULT_BRANCH (supported since Git 2.28).
This commit is contained in:
2026-05-11 19:05:13 +02:00
parent 4f9944101f
commit 1a17b852a1
4 changed files with 596 additions and 7 deletions
+153
View File
@@ -0,0 +1,153 @@
{
lib,
stdenv,
fetchFromGitHub,
python3,
}:
# NOTE: First build will fail with a hash mismatch error.
# Copy the "got: sha256-XXX..." from the error and replace fakeHash below.
let
version = "3.0.6";
src = fetchFromGitHub {
owner = "plastic-labs";
repo = "honcho";
tag = "v${version}";
hash = lib.fakeHash;
};
pythonEnv = python3.withPackages (ps:
with ps; [
# Core web framework
fastapi
uvicorn
httptools
python-dotenv
sqlalchemy
fastapi-pagination
# Database & vector
pgvector
psycopg
greenlet
# LLM providers
openai
google-genai
# Utilities
httpx
rich
nanoid
alembic
pyjwt
tenacity
tiktoken
langfuse
pydantic
pydantic-settings
pdfplumber
typing-extensions
json-repair
scikit-learn
prometheus-client
cloudevents
# Vector store backends
turbopuffer
lancedb
pyarrow
# Cache
redis
cashews
# Observability
sentry-sdk
]);
in
stdenv.mkDerivation {
pname = "honcho";
inherit version src;
buildInputs = [pythonEnv];
buildPhase = ''
rm -rf sdks honcho-cli
'';
installPhase = ''
mkdir -p $out/{src,migrations,scripts,bin}
cp -r src/* $out/src/
cp -r migrations/* $out/migrations/
cp scripts/provision_db.py $out/scripts/
cp alembic.ini $out/
# API wrapper
cat > $out/bin/honcho-api << 'WRAPPER'
#!/bin/sh
exec ${pythonEnv}/bin/python -c "
import sys, os
app_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
os.chdir(app_dir)
sys.path.insert(0, app_dir)
os.environ.setdefault('PYTHON_DOTENV_DISABLED', 'true')
os.environ.setdefault('HONCHO_CONFIG_TOML_DISABLED', 'true')
import uvicorn
port = int(os.environ.get('PORT', '8000'))
for i, arg in enumerate(sys.argv[1:]):
if arg.startswith('--port='):
port = int(arg.split('=',1)[1])
elif arg == '--port':
nxt = sys.argv[i+2:i+3]
if nxt: port = int(nxt[0])
uvicorn.run('src.main:app', host='0.0.0.0', port=port)
" "$@"
WRAPPER
chmod +x $out/bin/honcho-api
# Deriver wrapper
cat > $out/bin/honcho-deriver << 'WRAPPER'
#!/bin/sh
exec ${pythonEnv}/bin/python -c "
import sys, os
app_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
os.chdir(app_dir)
sys.path.insert(0, app_dir)
os.environ.setdefault('PYTHON_DOTENV_DISABLED', 'true')
os.environ.setdefault('HONCHO_CONFIG_TOML_DISABLED', 'true')
from src.deriver.__main__ import *
" "$@"
WRAPPER
chmod +x $out/bin/honcho-deriver
# Migration wrapper
cat > $out/bin/honcho-migrate << 'WRAPPER'
#!/bin/sh
exec ${pythonEnv}/bin/python -c "
import sys, os, asyncio
app_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
os.chdir(app_dir)
sys.path.insert(0, app_dir)
os.environ.setdefault('PYTHON_DOTENV_DISABLED', 'true')
os.environ.setdefault('HONCHO_CONFIG_TOML_DISABLED', 'true')
from src.db import init_db
asyncio.run(init_db())
" "$@"
WRAPPER
chmod +x $out/bin/honcho-migrate
'';
passthru = {
inherit pythonEnv;
python = pythonEnv;
};
meta = {
description = "Honcho Memory system for stateful AI agents";
homepage = "https://honcho.dev";
license = lib.licenses.agpl3Only;
platforms = lib.platforms.linux;
};
}