Skip to content

fix(darwin): use stable app path to prevent installs.ini accumulation#150

Merged
luisnquin merged 5 commits into0xc000022070:mainfrom
retX0:fix/darwin-stable-app-path
Nov 5, 2025
Merged

fix(darwin): use stable app path to prevent installs.ini accumulation#150
luisnquin merged 5 commits into0xc000022070:mainfrom
retX0:fix/darwin-stable-app-path

Conversation

@retX0
Copy link
Copy Markdown
Contributor

@retX0 retX0 commented Nov 5, 2025

Problem:

  • Zen Browser creates install IDs based on the application path
  • Wrapper script uses Nix store path which changes on every rebuild
  • Each new path creates a new install ID entry in installs.ini
  • Results in: multiple Dock icons, empty profiles, data loss

Solution:

  • Use the stable Home Manager symlink path (~/.../Home Manager Apps/...)
  • This path remains constant across Nix rebuilds
  • Zen Browser sees the same path every time, reuses existing install ID
  • Falls back to store path if symlink doesn't exist yet

Benefits:

  • No activation scripts or workarounds needed
  • Fixes root cause instead of symptoms
  • Maintains profile continuity naturally
  • Clean, elegant solution

retX0 added 5 commits November 4, 2025 18:26
Previously, policies.json was only installed for Linux builds,
causing browser policies (including ExtensionSettings) to be
ignored on macOS. This resulted in extensions not being automatically
installed on macOS systems.

This fix adds the policies.json installation to the Darwin install
phase, mirroring the Linux behavior and ensuring policy enforcement
works correctly on macOS.

Fixes extension auto-installation and other policy-based features on macOS.
Problem:
- Zen Browser creates install IDs based on the application path
- Wrapper script uses Nix store path which changes on every rebuild
- Each new path creates a new install ID entry in installs.ini
- Results in: multiple Dock icons, empty profiles, data loss

Solution:
- Use the stable Home Manager symlink path (~/.../Home Manager Apps/...)
- This path remains constant across Nix rebuilds
- Zen Browser sees the same path every time, reuses existing install ID
- Falls back to store path if symlink doesn't exist yet

Benefits:
- No activation scripts or workarounds needed
- Fixes root cause instead of symptoms
- Maintains profile continuity naturally
- Clean, elegant solution
Problem:
- SQLite WAL mode writes changes to .sqlite-wal file first
- Changes aren't visible until WAL is checkpointed to main file
- Zen Browser reads stale data from main file on startup
- User needs to wait or manually trigger checkpoint to see updates

Solution:
- Execute PRAGMA wal_checkpoint(FULL) after all updates
- Forces immediate merge of WAL changes to main database file
- Ensures spaces/pins updates are visible on next Zen startup

This fixes the delay between home-manager rebuild and seeing
configuration changes in Zen Browser.
Problem:
- AdGuard recognizes apps by code signing identifier, not CFBundleIdentifier
- Nix's adhoc re-signing changes identifier from 'app.zen-browser.zen' to 'zen'
- This breaks AdGuard's app filtering for Nix-built Zen Browser

Solution:
- Explicitly set --identifier flag when re-signing with codesign
- Maintains 'app.zen-browser.zen' identifier for AdGuard compatibility
- Ensures proper ad-blocking and app recognition

This allows AdGuard and other security tools to correctly identify
Zen Browser even when built through Nix.
@luisnquin luisnquin merged commit 21a7276 into 0xc000022070:main Nov 5, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants