nix module: YTDLP_PATH is never read; norish looks for yt-dlp in /app/bin #1

Open
opened 2026-09-27 18:11:26 -07:00 by oap · 0 comments
Owner

Problem

nix/module.nix (line 170 on main and on nas-0.17.3) sets:

YTDLP_PATH = "${pkgs.yt-dlp}/bin/yt-dlp";

norish never reads YTDLP_PATH. It reads YT_DLP_BIN_DIR (packages/config/src/env-config-server.ts), and with NODE_ENV=production its default is /app/bin, the path in the Docker image. ensureYtDlpBinary() (packages/api/src/video/yt-dlp.ts) first runs fs.mkdir(path.dirname(ytDlpPath), { recursive: true }), so on NixOS every video operation fails before it starts:

"module":"videos","error":{"errno":-2,"code":"ENOENT","syscall":"mkdir","path":"/app"},
"videoUrl":"https://vp.nyt.com/video/2020/10/28/89532_1_Recipe-Video-CCCookies_wg_480p.mp4",
"msg":"Failed to process video from JSON-LD"

Seen on nas (nas-0.17.3, in the norish microVM, oap/nix-config#112) on 2026-09-27, when importing https://cooking.nytimes.com/recipes/1015819-chocolate-chip-cookies. The recipe imports, but without its video. The host norish had the same bug. With the module's ProtectSystem = "strict", /app could not be made even if it were wanted.

Fix

In nix/module.nix, replace the dead variable with the one norish reads:

YT_DLP_BIN_DIR = "${pkgs.yt-dlp}/bin";

fs.mkdir with recursive: true succeeds on a directory that exists, fs.access then finds yt-dlp, and in production norish never downloads a binary. Do it on main and on nas-0.17.3, then bump the norish input in nix-config.

Check

  • Import a recipe whose JSON-LD has a video (the NYT URL above). The log must not show ENOENT for /app, and the video must appear with the recipe.
  • YouTube imports also need AI and the video setting (isVideoParsingEnabled() in server-config-loader.ts). On nas both are off today, so a YouTube URL fails with "Video recipe parsing is not enabled." whatever this fix does.

🤖 Generated with Claude Code

## Problem `nix/module.nix` (line 170 on `main` and on `nas-0.17.3`) sets: ```nix YTDLP_PATH = "${pkgs.yt-dlp}/bin/yt-dlp"; ``` norish never reads `YTDLP_PATH`. It reads `YT_DLP_BIN_DIR` (`packages/config/src/env-config-server.ts`), and with `NODE_ENV=production` its default is `/app/bin`, the path in the Docker image. `ensureYtDlpBinary()` (`packages/api/src/video/yt-dlp.ts`) first runs `fs.mkdir(path.dirname(ytDlpPath), { recursive: true })`, so on NixOS every video operation fails before it starts: ``` "module":"videos","error":{"errno":-2,"code":"ENOENT","syscall":"mkdir","path":"/app"}, "videoUrl":"https://vp.nyt.com/video/2020/10/28/89532_1_Recipe-Video-CCCookies_wg_480p.mp4", "msg":"Failed to process video from JSON-LD" ``` Seen on nas (nas-0.17.3, in the norish microVM, oap/nix-config#112) on 2026-09-27, when importing https://cooking.nytimes.com/recipes/1015819-chocolate-chip-cookies. The recipe imports, but without its video. The host norish had the same bug. With the module's `ProtectSystem = "strict"`, `/app` could not be made even if it were wanted. ## Fix In `nix/module.nix`, replace the dead variable with the one norish reads: ```nix YT_DLP_BIN_DIR = "${pkgs.yt-dlp}/bin"; ``` `fs.mkdir` with `recursive: true` succeeds on a directory that exists, `fs.access` then finds `yt-dlp`, and in production norish never downloads a binary. Do it on `main` and on `nas-0.17.3`, then bump the `norish` input in nix-config. ## Check - Import a recipe whose JSON-LD has a video (the NYT URL above). The log must not show `ENOENT` for `/app`, and the video must appear with the recipe. - YouTube imports also need AI and the video setting (`isVideoParsingEnabled()` in `server-config-loader.ts`). On nas both are off today, so a YouTube URL fails with "Video recipe parsing is not enabled." whatever this fix does. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
oap/norish#1
No description provided.