Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions hm-module.nix
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,9 @@ in {
${optionalString (profile.spacesForce) deleteSpaces}
${optionalString (profile.pins != {}) insertPins}
${optionalString (profile.pinsForce) deletePins}

# Force WAL checkpoint to ensure changes are visible immediately
${sqlite3} "${placesFile}" "PRAGMA wal_checkpoint(FULL);" || exit 1
}

error="$(update_places 2>&1 1>/dev/null)"
Expand Down
17 changes: 16 additions & 1 deletion package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,24 @@
mkdir -p "$out/Applications/${applicationName}.app/Contents/Resources/distribution"
ln -s ${policiesJson} "$out/Applications/${applicationName}.app/Contents/Resources/distribution/policies.json"

# Re-sign with correct identifier to maintain AdGuard compatibility
# AdGuard uses code signing identifier (not CFBundleIdentifier) to recognize apps
/usr/bin/codesign --force --deep --sign - \
--identifier "app.zen-browser.zen" \
"$out/Applications/${applicationName}.app"

# Use symlink path to avoid installs.ini accumulation on Nix rebuilds
# The symlink is created by home-manager and remains stable across rebuilds
cat > "$out/bin/${binaryName}" << EOF
#!/bin/bash
exec /usr/bin/open -na "$out/Applications/${applicationName}.app" --args "\$@"
# Use stable path from home-manager to avoid creating new install IDs
STABLE_PATH="\$HOME/Applications/Home Manager Apps/${applicationName}.app"
if [[ -e "\$STABLE_PATH" ]]; then
exec /usr/bin/open -na "\$STABLE_PATH" --args "\$@"
else
# Fallback to nix store path if symlink doesn't exist yet
exec /usr/bin/open -na "$out/Applications/${applicationName}.app" --args "\$@"
fi
EOF

chmod +x "$out/bin/${binaryName}"
Expand Down