How to install org-roam declaratively (Doom Emacs)

I’m using Nixos 22.11 with Doom Emacs 28.2. I would like to use org-roam but installing it through Doom Emacs throws the error No EmacSQL SQLite binary available, aborting even though i have sqlite in my environment.systemPackages and available in the terminal as sqlite3.

I understand that this is related to emacs not being able to compile some binary like with vterm so i uninstalled org-roam in Doom Emacs and put the following under environment.systemPackages:

    ((emacsPackagesFor emacs).emacsWithPackages (epkgs: [
      epkgs.org-roam
      epkgs.org-roam-ui
      epkgs.org-roam-timestamps
      # epkgs.org-roam-bibtex
    ]))

However, now Emacs doesn’t find org-roam at all, although i could see that Nixos was installing org-roam and its dependencies. In the past, i installed vterm with this method and it worked so i don’t know why org-roam still doesn’t. This thread didn’t help me unfortunately, as the OP and the last poster compiled the binary themselves but i would like to install org-roam with nix.

Not realy an answer to your question of how to do it declaratively, but my workaround for the missing emacs-sqlite binary error has been to manually build it via make in .emacs.d/.local/straight/repos/emacsql/sqlite :man_shrugging:

1 Like

I believe last time I had to mess with emacs-sqlite, I did some hackery similar to @asymmetric, just using home-manager to dump a package into the location. Emacs picked it up fine in my case.

That said, it might be worth checking if org-roam is included in your load-path correctly before trying to brute force it. The nix init file is finnicky and adding doom can’t make it much better.

Could you please expand on both options, especially on the load path one?

I never used make and i don’t know about the load path of emacs. Some functions like (setq lsp-clients-lua-language-server-bin "/run/current-system/sw/bin/lua-language-server") let me point emacs to Nixos’y peculiarities but i’m not aware of a similar function to help in my problem with org-roam. Also, installing vterm via Nixos worked fine, is the org-roam package maybe defined incorrectly?

In emacs, use M-x describe-variable, and then type load-path. It’ll give you something along these lines:

("/etc/profiles/per-user/tlater/share/emacs/site-lisp/" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/ahk-mode-20200412.1832" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/alert-20221110.1614" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/async-20221103.638" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/auto-package-update-20211108.2025" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/avy-20220910.1936" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/bazel-20221105.2049" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/biblio-20210418.406" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/biblio-core-20210418.406" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/bibtex-completion-20221024.857" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/bind-key-20221117.1610" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/cargo-mode-20210605.1003" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/citeproc-20221105.1054" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/closql-20221017.952" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/company-20221007.2145" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/compat-28.1.2.2" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/crux-20210811.436" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/csv-mode-1.21" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/cython-mode-20211111.1407" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/dash-20221013.836" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/dash-docs-20210830.926" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/dashboard-20221118.1318" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/deadgrep-20221101.2055" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/diff-hl-20221007.2147" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/dired-collapse-20210403.1230" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/dired-filter-20191105.1404" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/dired-hacks-utils-20201005.2318" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/dired-narrow-20181114.1723" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/dired-subtree-20210105.1127" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/direnv-20220812.956" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/dockerfile-mode-20220822.2021" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/edit-indirect-20220511.1124" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/eglot-20221020.1010" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/eldoc-1.13.0" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/elm-mode-20221025.1514" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/emacsql-20221024.1455" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/emacsql-sqlite-20221024.1455" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/exec-path-from-shell-20220826.1535" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/f-20220911.711" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/fic-mode-20180603.2035" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/flymake-1.2.2" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/flymake-shellcheck-20220308.2218" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/forge-20221025.1208" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/gcmh-20201116.2251" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/ghub-20220918.2022" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/git-commit-20221106.1128" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/glsl-mode-20210808.1945" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/gntp-20141025.250" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/gnuplot-20221112.2049" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/gotham-theme-20220107.1730" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/graphql-mode-20220716.827" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/groovy-mode-20220212.646" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/haskell-mode-20221113.1425" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/helm-20221117.1800" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/helm-core-20221113.1706" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/helm-dash-20190527.1118" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/helm-projectile-20220820.826" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/helm-rg-20200721.725" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/helm-tramp-20190616.125" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/ht-20221031.705" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/htmlize-20210825.2150" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/hydra-20220910.1206" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/json-mode-20211011.630" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/json-snatcher-20200916.1717" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/jsonnet-mode-20220121.2109" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/jsonrpc-1.0.15" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/kotlin-mode-20220527.1646" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/let-alist-1.0.6" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/log4e-20211019.948" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/lua-mode-20220801.503" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/lv-20200507.1518" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/magit-20221113.2221" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/magit-lfs-20221031.1447" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/magit-section-20220929.1014" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/markdown-mode-20221105.236" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/nadvice-0.3" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/nginx-mode-20170612.437" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/nix-mode-20221109.17" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/org-9.5.5" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/org-ref-20221015.1308" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/ox-pandoc-20220705.1036" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/parsebib-20221007.1402" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/popup-20220927.1610" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/prettier-js-20180109.726" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/projectile-20221118.1035" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/protobuf-mode-20220303.1716" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/python-pytest-20221021.1937" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/queue-0.2" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/rainbow-mode-1.0.6" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/reformatter-20220627.825" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/rich-minority-20190419.1136" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/rust-mode-20220919.1051" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/s-20220902.1511" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/scss-mode-20180123.1708" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/separedit-20221117.642" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/smart-mode-line-20211005.233" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/smartparens-20220623.1523" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/spinner-1.7.4" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/string-inflection-20220910.1306" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/stumpwm-mode-20140131.216" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/systemd-20210209.2052" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/transient-20221118.1443" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/treepy-20220919.759" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/undo-tree-0.8.2" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/use-package-20221117.1610" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/vterm-20221118.1354" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/web-mode-20221012.800" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/whitespace-cleanup-mode-20210510.533" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/with-editor-20220810.1159" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/xref-1.5.1" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/xterm-color-20200605.2017" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/yaml-20220720.2359" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/yaml-mode-20221022.920" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/yasnippet-20200604.246" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/company-20221007.2145/icons" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/company-20221007.2145/images" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/dashboard-20221118.1318/banners" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/emacsql-sqlite-20221024.1455/sqlite" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/org-9.5.5/etc" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/org-ref-20221015.1308/citeproc" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/vterm-20221118.1354/etc" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/company-20221007.2145/icons/vscode-dark" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/company-20221007.2145/icons/vscode-light" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/company-20221007.2145/images/small" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/org-9.5.5/etc/csl" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/org-9.5.5/etc/styles" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/org-ref-20221015.1308/citeproc/csl-locales" "/nix/store/45hlrppx5cqacs4ndch2xsa4zryrnq07-emacs-packages-deps/share/emacs/site-lisp/elpa/org-ref-20221015.1308/citeproc/csl-styles" "/nix/store/cbmkv2ca9d6n4k2ybscl0n5hl49j92pn-emacs-packages-deps/share/emacs/site-lisp" "/nix/store/0sc9hmy8mi0hdmsavmhfxhhqdag8jlp6-emacs-28.2/share/emacs/28.2/site-lisp" "/nix/store/0sc9hmy8mi0hdmsavmhfxhhqdag8jlp6-emacs-28.2/share/emacs/site-lisp" "/nix/store/0sc9hmy8mi0hdmsavmhfxhhqdag8jlp6-emacs-28.2/share/emacs/28.2/lisp" "/nix/store/0sc9hmy8mi0hdmsavmhfxhhqdag8jlp6-emacs-28.2/share/emacs/28.2/lisp/vc" "/nix/store/0sc9hmy8mi0hdmsavmhfxhhqdag8jlp6-emacs-28.2/share/emacs/28.2/lisp/url" "/nix/store/0sc9hmy8mi0hdmsavmhfxhhqdag8jlp6-emacs-28.2/share/emacs/28.2/lisp/textmodes" "/nix/store/0sc9hmy8mi0hdmsavmhfxhhqdag8jlp6-emacs-28.2/share/emacs/28.2/lisp/progmodes" "/nix/store/0sc9hmy8mi0hdmsavmhfxhhqdag8jlp6-emacs-28.2/share/emacs/28.2/lisp/play" "/nix/store/0sc9hmy8mi0hdmsavmhfxhhqdag8jlp6-emacs-28.2/share/emacs/28.2/lisp/org" "/nix/store/0sc9hmy8mi0hdmsavmhfxhhqdag8jlp6-emacs-28.2/share/emacs/28.2/lisp/nxml" "/nix/store/0sc9hmy8mi0hdmsavmhfxhhqdag8jlp6-emacs-28.2/share/emacs/28.2/lisp/net" "/nix/store/0sc9hmy8mi0hdmsavmhfxhhqdag8jlp6-emacs-28.2/share/emacs/28.2/lisp/mh-e" "/nix/store/0sc9hmy8mi0hdmsavmhfxhhqdag8jlp6-emacs-28.2/share/emacs/28.2/lisp/mail" "/nix/store/0sc9hmy8mi0hdmsavmhfxhhqdag8jlp6-emacs-28.2/share/emacs/28.2/lisp/leim" "/nix/store/0sc9hmy8mi0hdmsavmhfxhhqdag8jlp6-emacs-28.2/share/emacs/28.2/lisp/language" "/nix/store/0sc9hmy8mi0hdmsavmhfxhhqdag8jlp6-emacs-28.2/share/emacs/28.2/lisp/international" "/nix/store/0sc9hmy8mi0hdmsavmhfxhhqdag8jlp6-emacs-28.2/share/emacs/28.2/lisp/image" "/nix/store/0sc9hmy8mi0hdmsavmhfxhhqdag8jlp6-emacs-28.2/share/emacs/28.2/lisp/gnus" "/nix/store/0sc9hmy8mi0hdmsavmhfxhhqdag8jlp6-emacs-28.2/share/emacs/28.2/lisp/eshell" "/nix/store/0sc9hmy8mi0hdmsavmhfxhhqdag8jlp6-emacs-28.2/share/emacs/28.2/lisp/erc" "/nix/store/0sc9hmy8mi0hdmsavmhfxhhqdag8jlp6-emacs-28.2/share/emacs/28.2/lisp/emulation" "/nix/store/0sc9hmy8mi0hdmsavmhfxhhqdag8jlp6-emacs-28.2/share/emacs/28.2/lisp/emacs-lisp" "/nix/store/0sc9hmy8mi0hdmsavmhfxhhqdag8jlp6-emacs-28.2/share/emacs/28.2/lisp/cedet" "/nix/store/0sc9hmy8mi0hdmsavmhfxhhqdag8jlp6-emacs-28.2/share/emacs/28.2/lisp/calendar" "/nix/store/0sc9hmy8mi0hdmsavmhfxhhqdag8jlp6-emacs-28.2/share/emacs/28.2/lisp/calc" "/nix/store/0sc9hmy8mi0hdmsavmhfxhhqdag8jlp6-emacs-28.2/share/emacs/28.2/lisp/obsolete")

As you see there should be a nix store directory for each package. If org-roam is not in there, I’d suspect an issue with your init files somewhere, either caused by installing doom on top of nix’ normal scripts, or something else.

Org-roam could very well be misdefined, aiui these are all auto-generated from melpa, and depending on how the sqlite package is supposed to work it might just not generate it right.

Thank you for the explanation. All the nix packages appear to be in the load path, e.g. "/nix/store/0jr36ijxznkd7xrw4zk9mcc72j20rr6f-emacs-packages-deps/share/emacs/site-lisp/elpa/org-roam-20220908.1625".

This might be a stupid question (i’m still learning Nixos and github processes etc.) but is it possible that someone with the required knowledge can look at these packages and check them? Should i file an issue on nixpkgs Github for that?

Yes, but:

  • Despite NixOS’ claims to reproducibility and whatnot, in practice your system probably isn’t perfectly reproducible because you can still create random files . If you want a 100% guarantee on that in the future, consider Erase your darlings: immutable infrastructure for mutable systems - Graham Christensen in the future.
  • There’s no guarantee anyone will actually look at the issue, especially with something as specific as this it’s likely you’ll have to fix it yourself anyway.

Therefore:

Maybe, but let’s just confirm your emacs is sane. Basic checklist:

  1. Have you rebooted lately?
  2. How did you install doom?
  3. How do you run emacs?
  4. Is there anything in your ~/.config/emacs that’s put there without nix?

Depending on your answers it might be hard to reproduce, and you’ll need to at least include more info.

I’d hold off on writing an issue for the moment though, it’d be good to know why org-roam isn’t working, and write that up as an issue instead, so the maintainer/whoever can just go and fix it. “It doesn’t work” issues tend to be dead ends, especially for bigger projects and without useful logs. Discourse is better for that.

1 Like

I see, let me answer your questions:

  1. yes, i reboot several times a day and every time something doesn’t work just to be sure.
  2. i installed it as prescribed on its website (fresh install, no preexisting ~/.emacs.d):
git clone --depth 1 https://github.com/doomemacs/doomemacs ~/.emacs.d
~/.emacs.d/bin/doom install
  1. i run GUI emacsclient but running it standalone doesn’t make a difference.
  2. i don’t have a ~/.config/emacs directory. I just have ~/.doom.d and ~/.emacs.d. I never manually tinkered with ~/.emacs.d, it is populated by Doom Emacs alone.

As a test, i uninstalled org in Doom Emacs and installed epkgs.evil-org with nix. This works, org is recognized correctly by Emacs but org-roam still isnt. As org-roam is installed and in the load path, i guess that emacs doesn’t recognize it as a valid module?

Unfortunately, there is no maintainer listed for emacsPackages.org-roam so i can’t contact him.

I was able to get org-roam working with the following procedure:

Install emacsql-sqlite through Nix. (Installing org-roam this way wouldn’t help much because that’s not the one with native C code.)

Then you need to indicate to Doom Emacs that you prefer the copy of emacsql-sqlite installed outside of Doom:

4 Likes

That works, thanks a lot!

I had installed emacsql-sqlite via nix before but i wasn’t aware that emacs wouldn’t use it unless explicitly told so.

I also added (package! emacsql :built-in 'prefer) because doom upgrade just failed when reaching emacsql.

This problem appears to be solved, but for what it’s worth – my config declaratively installs org-roam and emacsql-sqlite3 for Emacs and also declaratively installs sqlite, and everything just works. I’m using ordinary Emacs, though, not Doom.

Just wanted to note that this methodology (I’ve followed from your up-to-date main branch - pretty much just using the raw file as a module in my home manage config) seems to still require having a c compiler available as it still wants to compile. Not sure how you might modify this module to add this, but for now I just added gcc to my home packages and it works as a temporary solution.

(Note: I do have the :built-in prefer set in my packages.el)

I checked the list-packages and it clearly shows that the external emacsql-sqlite and emacsql is available from the nix store. BUT, when I check the values of emacsql-sqlite-data-root and emacsql-sqlite-executable it’s being set to the config in my home directory rather the module in my nix store.

Not sure what more I can try and debug this. If anyone has any thoughts around this, I would truly appreciate it.

The latest configuration shouldn’t have that problem. There was a problem a few months back, which I suspect is the issue you’re describing. I fixed it back in May with the following commit

fix(emacs): install emacsql via Nix · midchildan/dotfiles@f9b2978 · GitHub.

You might have to manually remove files like ~/.config/emacs/.local/straight/repos/emacsql* to completely solve the issue though.