You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A Vite define is text substitution, so passing an object emitted an
object literal where a string was expected; JSON.parse threw and the
catch silently loaded env.development.json. Every release therefore
ran its frontend with VITE_NIXMAC_SKIP_PERMISSIONS on, disabling the
permissions gate. Confirmed against a CI production bundle.
- one object-valued define, validated and coerced at build time, and
no fallback: a bad profile fails the build, or throws at startup
- NIXMAC_ENV only selects a profile and no longer overwrites the
selected file's own value; unknown selectors fail the build instead
of falling through to development
- a prod profile refuses the skip-permissions and nix-installed
bypasses whatever the profile asks for
- Rust resolves the environment through one path instead of three
- prerequisite steps are gated on onboarding being unfinished, so a
missing permission after setup is a banner, not an internal error
- an inconclusive Full Disk Access probe no longer counts against the
required-permission gate
/// Shown on the Full Disk Access row when every probe path was missing.
242
+
///
243
+
/// The probe reads files a granted process can read and a denied one cannot.
244
+
/// If none of them exist there is nothing to read, so it proves neither state —
245
+
/// say so, rather than implying we checked and found the access missing. The
246
+
/// other inconclusive path, a Mac with no home directory, has its own message.
247
+
constFULL_DISK_ACCESS_INCONCLUSIVE:&str = "Could not determine Full Disk Access: none of the files this check probes exist on this Mac. If a rebuild fails with a permissions error, add nixmac under System Settings → Privacy & Security → Full Disk Access.";
248
+
249
+
/// Check if we have Full Disk Access, with an explanation when inconclusive.
242
250
///
243
251
/// Probes several TCC-gated paths. A successful read on any one is proof of
244
252
/// FDA. A PermissionDenied on any one is proof of the opposite — even if the
245
253
/// user has nixmac listed and toggled on in System Settings, a stale TCC
246
254
/// entry (e.g. codesign requirement mismatch after an update-in-place) can
247
255
/// leave the grant silently inactive, and reads will fail with
248
-
/// PermissionDenied. Only if every probe path is missing (NotFound) do we
249
-
/// fall back to Pending.
250
-
fncheck_full_disk_access() -> PermissionStatus{
256
+
/// PermissionDenied. If every probe path is missing (NotFound) the probe has
257
+
/// established nothing, which is `Unknown` rather than `Pending` — the latter
258
+
/// reads as "not granted yet", which is a claim this probe cannot make.
259
+
///
260
+
/// `Unknown` still fails the onboarding gate on its own; what keeps an
261
+
/// unverifiable result from holding the gate shut is the caller dropping the
262
+
/// row's `required` flag (see the `full-disk` arm of `check_all_permissions`).
debug!("VITE_NIXMAC_SKIP_PERMISSIONS is set, assuming Full Disk Access granted");
253
-
returnPermissionStatus::Granted;
266
+
return(PermissionStatus::Granted,None);
254
267
}
255
268
ife2e_skip_permissions_enabled(){
256
269
debug!("E2E permission skip enabled, assuming Full Disk Access granted");
257
-
returnPermissionStatus::Granted;
270
+
return(PermissionStatus::Granted,None);
258
271
}
259
272
260
273
let home = match dirs::home_dir(){
261
274
Some(h) => h,
262
-
None => returnPermissionStatus::Unknown,
275
+
None => {
276
+
return(
277
+
PermissionStatus::Unknown,
278
+
Some("Could not determine Full Disk Access: this Mac reported no home directory, so the check could not run. If a rebuild fails with a permissions error, add nixmac under System Settings → Privacy & Security → Full Disk Access.".to_string()),
279
+
);
280
+
}
263
281
};
264
282
265
283
// (path, is_dir). Ordered by how reliably the path exists on a typical
description:"Required for darwin-rebuild to apply system changes".to_string(),
508
550
required:true,
509
551
can_request_programmatically:false,
510
-
status:check_full_disk_access(),
511
-
instructions:Some(
552
+
status,
553
+
instructions:Some(detail.unwrap_or_else(|| {
512
554
"First make sure nixmac is in your Applications folder (not running from the install disk image). Then go to System Settings → Privacy & Security → Full Disk Access and add nixmac to the list."
0 commit comments