Skip to content

Sync Obsidian vault continuously as a background service - #328

Open
crdant wants to merge 3 commits into
mainfrom
feature/crdant/syncs-obsidian-vault
Open

Sync Obsidian vault continuously as a background service#328
crdant wants to merge 3 commits into
mainfrom
feature/crdant/syncs-obsidian-vault

Conversation

@crdant

@crdant crdant commented Aug 14, 2026

Copy link
Copy Markdown
Owner

TL;DR

Keeps the Notes vault continuously synced in the background on machines that opt in: a new programs.obsidian.sync.enable toggle on the obsidian home module runs ob sync --continuous as a systemd user service on Linux and a launchd agent on macOS. Sync is off by default and enabled per host — currently on mash.

Details

Converts the obsidian home module to an options-style module (following the programs.claude convention) so importing it and enabling sync are separate decisions.

Adds host-specific home configurations: mkHomeConfig takes extraModules, and a crdant@mash home configuration layers systems/hosts/mash/home.nix — which enables sync — over the full profile, keeping host configuration together under systems/hosts/<host>/. Since home-manager resolves $USER@$HOSTNAME first, home-manager switch --flake . picks the host configuration automatically on mash.

Guards the Linux unit with ConditionPathExists on the obsidian-headless config so machines that haven't run ob login skip the service instead of crash-looping under Restart=on-failure. The launchd agent uses KeepAlive.SuccessfulExit = false for the same restart behavior on macOS.

🤖 Generated with Claude Code

crdant and others added 3 commits August 14, 2026 17:35
Add a programs.obsidian.sync.enable toggle to the obsidian home
module that runs 'ob sync --continuous' in the Notes vault — a
systemd user service on Linux, a launchd agent on Darwin. The
service skips machines where obsidian-headless isn't configured
yet. Enabled in the full profile.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Default programs.obsidian.sync.enable to off and enable it through
host-specific home configurations: mkHomeConfig now takes a hostname,
home.nix layers in home/users/<user>/<host>.nix when one exists, and
a crdant@mash configuration turns sync on for mash. As a bonus,
'home-manager switch --flake .' now resolves crdant@mash automatically
on that host.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Move the per-host home override from home/users/crdant/mash.nix to
systems/hosts/mash/home.nix so host configuration lives in one place.
The crdant@mash home configuration imports it directly via a new
extraModules argument on mkHomeConfig, replacing the hostname
special-arg threading.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.

1 participant