feat: add obsidian CLI config for headless kyber - #1438
Conversation
|
You do not have enough credits to review this pull request. Please purchase more credits to continue. |
|
Caution Review failedPull request was closed or merged during review No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughSummary by CodeRabbit
WalkthroughReorders module inclusions in the main config and adds a new Obsidian module with conditional initialization based on the host configuration. The module provides XDG configuration file management for Obsidian settings with CLI mode enabled. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Mesa DescriptionTL;DRAdded Obsidian CLI configuration for headless Kyber hosts by creating What changed?
Description generated by Mesa. Update settings |
There was a problem hiding this comment.
Code Review
This pull request introduces Obsidian configuration by adding a new module and an obsidian.json file, while also alphabetizing the imports in the main configuration. A review comment highlights that managing the configuration file via xdg.configFile results in a read-only symlink, which may prevent Obsidian from saving state or updating settings, and suggests using builtins.toJSON for a cleaner implementation if the file is intended to be read-only.
| source = ./obsidian.json; | ||
| enable = isKyber; |
There was a problem hiding this comment.
Managing obsidian.json via xdg.configFile creates a read-only symlink in the Nix store. Since Obsidian writes to this file to track vaults and other settings, this will prevent the application from saving state (like newly opened vaults) and may cause errors during CLI operations that attempt to update the configuration. If you only need to ensure the CLI is enabled and are okay with the file being read-only, you can simplify the implementation by using text with builtins.toJSON instead of a separate file (and then delete obsidian.json). Otherwise, consider using a home.activation script to modify the file in-place if you need it to remain writable.
text = builtins.toJSON { cli = true; };
enable = isKyber;
There was a problem hiding this comment.
Pull request overview
Adds a declarative Obsidian CLI enablement config for the headless “kyber” host, and wires it into the existing config/ module import list.
Changes:
- Add
config/obsidian/obsidian.jsonwith"cli": truefor Obsidian 1.12+ CLI enablement. - Add
config/obsidian/default.nixto deploy that config viaxdg.configFilegated byinputs.host.isKyber. - Update
config/default.nixto include the new./obsidianmodule and restore alphabetical ordering around that area.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| config/obsidian/obsidian.json | Introduces the Obsidian CLI enablement JSON config. |
| config/obsidian/default.nix | Deploys the JSON config to ~/.config/obsidian/obsidian.json only on kyber. |
| config/default.nix | Imports the new obsidian config module and reorders entries alphabetically. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
config/obsidian/obsidian.jsonwith{"cli": true}to enable Obsidian CLI on headless hostsxdg.configFileonly on kyberconfig/default.nixContext
Obsidian 1.12+ CLI requires
cli: truein~/.config/obsidian/obsidian.json(discovered by extracting the asar - the key iscli, notenabledClias docs suggest). Without a display server there's no way to toggle this via Settings UI, so we manage it declaratively.Test plan
home-manager switchon kyber deploys~/.config/obsidian/obsidian.jsonobsidian list-vaultsworks without "CLI not enabled" errorSummary by cubic
Enable Obsidian CLI on the headless
kyberhost by provisioning~/.config/obsidian/obsidian.jsonwith"cli": true. Also fixes the module list order inconfig/default.nix.New Features
config/obsidianto deployxdg.configFile."obsidian/obsidian.json"with"cli": true, enabled only whenisKyberis true.Refactors
config/default.nix.Written for commit f740522. Summary will update on new commits.