feat(home): yt-transcribe tool + watcher (captions-first, X via gallery-dl)

- yt-transcribe: YouTube/X/local-file transcription. Captions first
  (yt-dlp; X serves auto-captions via its twitter extractor), Whisper
  fallback (whisper-cli reusing OpenSuperWhisper's ggml model), reclip
  download reuse, INDEX.md + --list/--index for id->title mapping.
- watcher: launchd every 5 min over media/video on the Unraid share,
  sidecar .txt per download, marker-guarded, stale-marker purge.
- Code executes from the nix store via stable ~/.local/bin symlinks:
  launchd EPERMs on SMB exec; share stays data-only.
- brews: declare yt-dlp, whisper.cpp, gallery-dl (cleanup=zap removes
  undeclared formulas).
This commit is contained in:
Lap Tran committed 2026-10-25 13:08:25 -04:00
1 parent 9264bd0adf
commit 9821fde02b
4 files changed
+462 -1

No files matched your search

+22 -1
View File
@@ -4,6 +4,14 @@ let
home = config.home.homeDirectory;
dotfiles = "${home}/.dotfiles";
firstmateHome = "${home}/Documents/firstmate";
# yt-transcribe: captions-first transcription for YouTube/X/local media.
# Source of truth is this repo's home/bin scripts; nix copies them into the
# store so every context (launchd, shells) executes from local disk. Stable
# ~/.local/bin symlinks below survive store-path changes between rebuilds.
ytTranscribe = pkgs.runCommand "yt-transcribe" { } ''
install -Dm755 ${./home/bin/yt-transcribe} $out/bin/yt-transcribe
install -Dm755 ${./home/bin/yt-transcribe-watcher} $out/bin/yt-transcribe-watcher
'';
in
{
@@ -24,7 +32,7 @@ in
nerd-fonts.hack
ngrok # reverse TCP tunnel so the phone can SSH in over cellular (unfree)
beets # music tagger / library organizer + navidrome sync plugin
];
] ++ [ ytTranscribe ];
fonts.fontconfig.enable = true;
home.sessionVariables.EDITOR = "nvim";
@@ -51,6 +59,10 @@ in
oc2 = "${home}/.local/bin/oc2";
# Sync ~/Music into the beets library on Unraid (requires NAS mounted).
sync-music = "~/.local/bin/sync-music";
# Transcribe a YouTube/X URL or a local media file. Tool code lives in
# this repo (nix store); the Unraid share holds only data — mount it at
# /Volumes/data (or set YT_SHARE_ROOT for a different mount point).
yt-transcribe = "${home}/.local/bin/yt-transcribe";
# Start the reverse tunnel so you can SSH into this Mac from your phone.
# Run once when you go remote: `ngrok-tunnel`. Reads authtoken from
# ~/.config/ngrok (set once per machine with `ngrok config add-authtoken <TOK>`)
@@ -192,6 +204,15 @@ in
source = config.lib.file.mkOutOfStoreSymlink "${dotfiles}/home/bin/security-audit-sandbox";
force = true;
};
# Stable symlinks for yt-transcribe: launchd and shells exec these from local
# disk. The repo's home/bin scripts are the source of truth — a repo edit
# takes effect on the next rebuild; the Unraid share holds only data.
home.file.".local/bin/yt-transcribe" = {
source = "${ytTranscribe}/bin/yt-transcribe";
};
home.file.".local/bin/yt-transcribe-watcher" = {
source = "${ytTranscribe}/bin/yt-transcribe-watcher";
};
home.file.".grok/AGENTS.md" = {
source = config.lib.file.mkOutOfStoreSymlink "${dotfiles}/home/AGENTS.md";
force = true;