# Declarative emacs/doom/org-roam (newbie)

**URL:** https://discourse.nixos.org/t/declarative-emacs-doom-org-roam-newbie/24478
**Category:** Uncategorized
**Created:** [January 6, 2023, 11:44am UTC](https://discourse.nixos.org/t/declarative-emacs-doom-org-roam-newbie/24478 "2023-01-06T11:44:13Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![nixered](https://discourse.nixos.org/user_avatar/discourse.nixos.org/nixered/32/8245_2.png) [@nixered](https://discourse.nixos.org/u/nixered)
#### Post date: [January 6, 2023, 11:44am UTC](https://discourse.nixos.org/t/declarative-emacs-doom-org-roam-newbie/24478/1 "2023-01-06T11:44:13Z")

</div>

Hi everyone,

I’m completely new to nixos, finding my way around.

I’ve managed to install and configure the following (via “nix-env -i ”):  
emacs  
sqlite

I’ve also installed and configured doom-emacs and org-roam (via doom’s conf files).

**This is a two-part question:**  
How do I declaratively do all this in the overlays?  
How can I get org-roam to see the sqlite3 binary? “No EmacSQL binary available. Aborting.”

---

<div class="post-metadata">

### Author: ![tejing](https://discourse.nixos.org/user_avatar/discourse.nixos.org/tejing/32/4566_2.png) [@tejing](https://discourse.nixos.org/u/tejing)
#### Post date: [January 6, 2023, 8:36pm UTC](https://discourse.nixos.org/t/declarative-emacs-doom-org-roam-newbie/24478/2 "2023-01-06T20:36:19Z")

</div>

Firstly, on nixos, we really don’t recommend using `nix-env`. Install packages with `environment.systemPackages` in your `configuration.nix`, or use home-manager and install them through `home.packages` in `home.nix`. See [Stop using nix-env](https://discourse.nixos.org/t/stop-using-nix-env/20801) and [Depreciate the use of nix-env to install packages?](https://discourse.nixos.org/t/depreciate-the-use-of-nix-env-to-install-packages/20139) for more on that.

As for configuring emacs declaratively, it can get a bit more complicated. Doom emacs in particular already has its own systems for managing the config, so making it play nicely with nix can take a bit of doing. I wouldn’t recommend tackling the project of making that declarative as one of your first projects. Do something easier first.

When you’re ready, though, [nix-doom-emacs](https://github.com/nix-community/nix-doom-emacs) can be used. You basically make your doom.d part of your configuration rather than part of your runtime homedir, and doom emacs’ setup process happens inside a derivation to produce the runtime setup.

Unfortunately, I don’t know what the issue is with org-roam, however I suspect it may be fixed if you use org-roam as packaged for nix, rather than the one deployed through emacs’ own mechanisms.

---

<div class="post-metadata">

### Author: ![TLATER](https://discourse.nixos.org/user_avatar/discourse.nixos.org/tlater/32/4257_2.png) [@TLATER](https://discourse.nixos.org/u/TLATER)
#### Post date: [January 6, 2023, 10:02pm UTC](https://discourse.nixos.org/t/declarative-emacs-doom-org-roam-newbie/24478/3 "2023-01-06T22:02:14Z")

</div>

Amusingly, unless you just created a new account, someone else just asked the exact same thing. You can get emacs-sqlite to work like so, apparently doom comes with its own version that is of course totally broken on NixOS: [How to install org-roam declaratively (Doom Emacs) - #9 by midchildan](https://discourse.nixos.org/t/how-to-install-org-roam-declaratively-doom-emacs/24459/9)
