How do I have more than one Org-roam directory?
Emacs supports directory-local variables, allowing the value of org-roam-directory to be different in different directories. It does this by checking for a file named .dir-locals.el.
To add support for multiple directories, override the org-roam-directory variable using directory-local variables. This is what .dir-locals.el may contain:
emacs-lisp
((nil . ((org-roam-directory . "/path/to/alt/org-roam-dir")
(org-roam-db-location . "/path/to/alt/org-roam-dir/org-roam.db"))))Note org-roam-directory and org-roam-db-location should be an absolute path, not relative.
Alternatively, use eval if you wish to call functions:
emacs-lisp
((nil . ((eval . (setq-local
org-roam-directory (expand-file-name (locate-dominating-file
default-directory ".dir-locals.el"))))
(eval . (setq-local
org-roam-db-location (expand-file-name "org-roam.db"
org-roam-directory))))))All files within that directory will be treated as their own separate set of Org-roam files. Remember to run org-roam-db-sync from a file within that directory, at least once.