   ;; for these variables. If not, default values will be set in the :config
   ;; section.
   (defvar org-roam-directory nil)
-  (defvar org-roam-db-location nil)
 
   :init
   (doom-load-packages-incrementally

          (expand-file-name org-directory)
          (file-truename)
          (file-name-as-directory))
        org-roam-db-location
        (or org-roam-db-location
            (concat doom-etc-dir "org-roam.db"))
        org-roam-node-display-template
        "${doom-hierarchy:*} ${doom-tags:45}"
        org-roam-completion-everywhere t
        org-roam-mode-section-functions
        #'(org-roam-backlinks-section
           org-roam-reflinks-section)
        org-roam-db-gc-threshold most-positive-fixnum
        ;; Reverse the default to favor faster searchers over slower ones.
        org-roam-list-files-commands '(fd fdfind rg find))

      ("^\\*org-roam: " ; node dedicated org-roam buffer
       :side right :width 0.33 :height 0.5 :ttl nil :modeline nil :quit nil :slot 2)))

  ;; Soft-wrap lines in the backlinks buffer
  (add-hook 'org-roam-mode-hook #'turn-on-visual-line-mode)

  (map! :map org-mode-map
        :localleader
        :prefix ("m" . "org-roam")
        "D" #'org-roam-demote-entire-buffer
        "f" #'org-roam-node-find
        "F" #'org-roam-ref-find
        "g" #'org-roam-graph
        "i" #'org-roam-node-insert
        "I" #'org-id-get-create
        "m" #'org-roam-buffer-toggle
        "M" #'org-roam-buffer-display-dedicated
        "n" #'org-roam-capture
        "r" #'org-roam-refile
        "R" #'org-roam-link-replace-all
        (:prefix ("d" . "by date")
         :desc "Goto previous note" "b" #'org-roam-dailies-goto-previous-note
         :desc "Goto date"          "d" #'org-roam-dailies-goto-date
         :desc "Capture date"       "D" #'org-roam-dailies-capture-date
         :desc "Goto next note"     "f" #'org-roam-dailies-goto-next-note
         :desc "Goto tomorrow"      "m" #'org-roam-dailies-goto-tomorrow
         :desc "Capture tomorrow"   "M" #'org-roam-dailies-capture-tomorrow
         :desc "Capture today"      "n" #'org-roam-dailies-capture-today
         :desc "Goto today"         "t" #'org-roam-dailies-goto-today
         :desc "Capture today"      "T" #'org-roam-dailies-capture-today
         :desc "Goto yesterday"     "y" #'org-roam-dailies-goto-yesterday
         :desc "Capture yesterday"  "Y" #'org-roam-dailies-capture-yesterday
         :desc "Find directory"     "-" #'org-roam-dailies-find-directory)
        (:prefix ("o" . "node properties")
         "a" #'org-roam-alias-add
         "A" #'org-roam-alias-remove
         "t" #'org-roam-tag-add
         "T" #'org-roam-tag-remove
         "r" #'org-roam-ref-add
         "R" #'org-roam-ref-remove))

  (when (featurep! :editor evil +everywhere)
    (add-hook! 'org-roam-mode-hook
