diff options
| author | tv <tv@krebsco.de> | 2026-11-20 16:46:08 +0000 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-11-20 17:52:50 +0100 |
| commit | 8991231294de10921bd0a37ea862a56d10d59101 (patch) | |
| tree | b11bcb959f5557c7bf9096e44c2a14bd2b1f4ae7 /configs/hermes.nix | |
| parent | 67482f39ff46ec5e7b32ec1c98441f3088af9e7d (diff) | |
configs/hermes: no second timestamp in the gateway's journal lines
The gateway formats its stderr log lines with a timestamp of their own,
which journald adds anyway. Patch hermes-agent's source to leave it out
when stderr is the journal (JOURNAL_STREAM is set); the log files in
~/.hermes/logs keep theirs.
Diffstat (limited to 'configs/hermes.nix')
| -rw-r--r-- | configs/hermes.nix | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/configs/hermes.nix b/configs/hermes.nix index 7255fc3..ab04b15 100644 --- a/configs/hermes.nix +++ b/configs/hermes.nix @@ -38,11 +38,21 @@ let # Fetched with the host's pkgs (see default.nix), as imports need it. # Bump rev and hash together. - src = hostPkgs.fetchFromGitHub { - owner = "NousResearch"; - repo = "hermes-agent"; - rev = "9f47677483d1b4de4d1a88d37b3b7ca18b18b215"; - hash = "sha256-4fRnt5Dh7bbuNR6XODpuhoXP/XOrZP0Fc5XqYuvj+/Y="; + src = hostPkgs.applyPatches { + name = "hermes-agent-source"; + src = hostPkgs.fetchFromGitHub { + owner = "NousResearch"; + repo = "hermes-agent"; + rev = "9f47677483d1b4de4d1a88d37b3b7ca18b18b215"; + hash = "sha256-4fRnt5Dh7bbuNR6XODpuhoXP/XOrZP0Fc5XqYuvj+/Y="; + }; + # The gateway's log lines on stderr get a timestamp of their own, which + # journald adds anyway: leave it out when stderr is the journal. + postPatch = '' + substituteInPlace gateway/run.py --replace-fail \ + 'RedactingFormatter("%(asctime)s %(levelname)s %(name)s: %(message)s")' \ + 'RedactingFormatter(("" if os.environ.get("JOURNAL_STREAM") else "%(asctime)s ") + "%(levelname)s %(name)s: %(message)s")' + ''; }; # hermes-agent's flake without flakes, like flake-compat, but with this |
