Files
nix-stuff/common/shell/vacuhistory.nix
Shelvacu 91a27769ba stuff
2025-05-23 17:56:46 -07:00

16 lines
586 B
Nix

{ pkgs, ... }:
{
config.vacu = {
shell.idempotentShellLines = ''
if [[ -z "''${VACU_HISTORY_SESSION_ID-}" ]]; then
VACU_HISTORY_SESSION_ID="$(${pkgs.libossp_uuid}/bin/uuid)"
fi
VACU_HISTORY_DB_PATH="$HOME/vacu-shell-history.sqlite"
function vacu_history_record() {
LC_ALL=C HISTTIMEFORMAT='%S|%M|%H|%d|%m|%Y|%w|%j|%z|' history 1 | VACU_HISTORY_SESSION_ID="$VACU_HISTORY_SESSION_ID" VACU_HISTORY_DB_PATH="$VACU_HISTORY_DB_PATH" ${pkgs.vacu-history}/bin/vacu-history
}
PS0='$(vacu_history_record >/dev/null)'"$PS0"
'';
};
}