fix(mime): text/plain falls through to Text Editor on live (#119)
All checks were successful
Check / eval (push) Successful in 4m5s

A singleton default naming code.desktop left the live ISO with no text
handler — GIO skips missing .desktop files and offers nothing. Prefer
vscode when present, then org.gnome.TextEditor.desktop. Live also gains
mpv (video defaults had the same hole; free via the template pin).

checks.live-baseline-apps now requires every Default Applications key
to resolve to a present .desktop on live (HM + system path) and on the
default template install. Proved to fail on a vscode-only text/plain.

Verified: V2 (live-baseline-apps green + prove-to-fail); V0 flake check.
This commit is contained in:
2026-07-15 09:24:48 +01:00
parent 6fbad46bca
commit 355d8cb1a4
6 changed files with 125 additions and 48 deletions

View File

@@ -55,31 +55,6 @@ template source. Pass = Chromium launches after installation and HTTP/HTTPS
mime defaults resolve to `chromium-browser.desktop` (and the intended live-ISO
browser posture is explicit).
### 119. `text/plain` names vscode, which the live ISO does not ship
Found while shipping #103 (2026-07-14), deliberately not fixed there — same
bug class as #94, one mime key over. `modules/home/mime.nix:48` assigns
`text/plain = code.desktop`, and vscode ships only in the **template**, never
on the live ISO. GIO silently skips an entry whose desktop file is absent, so
opening a text file in the live session finds no handler at all — the exact
shape of the no-default-browser bug, and now the only one left of its kind
since #103 put chromium on the live medium.
Two ways it bites, and a fix should settle both: (1) the live session, which
now ships `gnome-text-editor` (`org.gnome.TextEditor.desktop`) — the obvious
live handler; (2) any installed machine where the user takes the template at
its word and deletes the `vscode` line (opt-out = delete the line, per the
option-surface convention), which silently breaks `text/plain` with no warning.
The general trap is worth fixing once rather than per-key: a mime default
naming a package the profile does not carry is invisible until a user
double-clicks a file. `checks.live-baseline-apps` now guards exactly this for
HTTPS (asserts the named .desktop is present, not merely named) — the cheap
version of this item is extending that assertion to every key in
`defaultApplications`, which would have caught both #94 and this. Pass = no
mime default names a desktop entry the profile lacks, on the live ISO and on
a template install, and a guard fails on a regression.
### 95. Live ISO/install: Ghostty does not open
Reproduce from the launcher and a terminal, capture its stderr/journal, and