File tree Expand file tree Collapse file tree
packages/obsidian-headless Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88 # node_modules that includes its own pi 0.83.0 — so it needs nothing else from
99 # this account and survives recreations regardless of backup.
1010 pilegram = inputs . pilegram . packages . ${ pkgs . system } . default ;
11+ # Official Obsidian Sync headless CLI, packaged here so the assistant can run
12+ # on-demand vault syncs without fetching npm packages at runtime.
13+ obsidian-headless = import ../../../packages/obsidian-headless { inherit pkgs ; } ;
14+ obsidian-sync = pkgs . writeShellScriptBin "obsidian-sync" ''
15+ set -eu
16+ vault="'' ${OBSIDIAN_VAULT_DIR:-/var/lib/assistant/Vault}"
17+ exec ${ obsidian-headless } /bin/ob sync --path "$vault" "$@"
18+ '' ;
1119in
1220{
1321 users . users . assistant = {
3442 fd # pi checks for fd at interactive startup and uses it for file autocomplete/find.
3543 ledger
3644 chromium
45+ obsidian-headless
46+ obsidian-sync
3747 ] ;
3848 } ;
3949 users . groups . assistant . gid = 2001 ;
Original file line number Diff line number Diff line change 1+ { pkgs } :
2+ let
3+ inherit ( pkgs ) lib ;
4+ in
5+ pkgs . buildNpmPackage {
6+ pname = "obsidian-headless" ;
7+ version = "0.0.14" ;
8+
9+ src = pkgs . fetchurl {
10+ url = "https://registry.npmjs.org/obsidian-headless/-/obsidian-headless-0.0.14.tgz" ;
11+ hash = "sha512-S1d/hxLKvCUG2g5tRyXFkzPqMs3Ntw1tDyzoF2yfHGRuB4B+Mi3X2vgT8LbfQKrkEEi3LfJRdXtYzAVHcbpccw==" ;
12+ } ;
13+ sourceRoot = "package" ;
14+
15+ postPatch = ''
16+ cp ${ ./package-lock.json } package-lock.json
17+ '' ;
18+
19+ npmDepsHash = "sha256-Pcy6hxgc9MyTe/a7bE4pMtXjG9hx4HNwZgbfIzTtVRQ=" ;
20+
21+ nodejs = pkgs . nodejs_22 ;
22+ dontNpmBuild = true ;
23+ npmFlags = [
24+ "--ignore-scripts"
25+ "--omit=dev"
26+ ] ;
27+
28+ meta = {
29+ description = "Headless client for Obsidian Sync and Publish" ;
30+ homepage = "https://github.com/obsidianmd/obsidian-headless" ;
31+ license = lib . licenses . mit ;
32+ mainProgram = "ob" ;
33+ } ;
34+ }
You can’t perform that action at this time.
0 commit comments