Skip to content

Commit 5cab919

Browse files
assistant-ngalaiko[bot]ngalaiko
authored andcommitted
Run assistant Obsidian sync continuously
1 parent 3630467 commit 5cab919

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

hosts/exedev/users/assistant.nix

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,34 @@ in
6868
];
6969
};
7070

71+
# Keep the assistant's Obsidian vault connected to Obsidian Sync. The auth,
72+
# sync setup, and vault data are runtime state under the backed-up assistant
73+
# home; this service only starts once backup restore has completed.
74+
s6.services.assistant-obsidian-sync = {
75+
dependencies = [
76+
"base"
77+
"backup-restore"
78+
];
79+
run = ''
80+
vault=/var/lib/assistant/Vault
81+
if [ ! -d "$vault/.obsidian" ]; then
82+
echo "assistant-obsidian-sync: $vault is not configured yet; run ob login + ob sync-setup once. Retrying." >&2
83+
sleep 30
84+
exit 1
85+
fi
86+
exec /command/s6-setuidgid assistant \
87+
env \
88+
HOME=/var/lib/assistant \
89+
USER=assistant \
90+
SHELL=/bin/sh \
91+
PATH=/etc/profiles/per-user/assistant/bin:/nix/var/nix/profiles/default/bin:/bin:/sbin:/usr/bin \
92+
SSL_CERT_FILE=/etc/ssl/certs/ca-bundle.crt \
93+
NIX_SSL_CERT_FILE=/etc/ssl/certs/ca-bundle.crt \
94+
NODE_EXTRA_CA_CERTS=/etc/ssl/certs/ca-bundle.crt \
95+
${obsidian-headless}/bin/ob sync --path "$vault" --continuous
96+
'';
97+
};
98+
7199
# Telegram bridge for pi, via pilegram (the flake input above). Long-polling
72100
# needs only outbound HTTPS, so nothing is exposed on the tailnet or the image.
73101
# pilegram reads pi's provider keys from ~/.pi and keeps its own state under

0 commit comments

Comments
 (0)