---
# System prepended metadata

title: PID-1018

---

To configure Doom Emacs in configuration.nix using the home-manager module, we can use the nix-doom-emacs package. This package provides a Nix expression to install and configure Doom Emacs. It builds a Doom Emacs distribution with dependencies pre-installed based on an existing `~/.doom.d` directory [1].

Here's an example of how to configure Doom Emacs in configuration.nix using the home-manager module:

```nix
{ config, pkgs, ... }:

let
  home-manager = import <home-manager> {};
  nix-doom-emacs = import (builtins.fetchTarball ""https://github.com/vlaci/nix-doom-emacs/archive/refs/heads/master.tar.gz"") {};
in

{
  home-manager.users.exampleUser = {
    pkgs = pkgs;
    home.file."".doom.d"" = {
      source = ./doom.d;
      type = ""directory"";
    };
    home.file."".config/nixpkgs/config.nix"" = {
      source = ./config.nix;
      type = ""file"";
    };
    home.packages = with pkgs; [
      nix-doom-emacs.doom-emacs
    ];
  };
}
```

In this example, we first import the home-manager module and the nix-doom-emacs package. We then define a user `exampleUser` and set the `pkgs` attribute to `pkgs`. We also define two home files: `./doom.d` as a directory and `./config.nix` as a file. We then set `home.packages` to include `nix-doom-emacs.doom-emacs`, which installs Doom Emacs. Finally, we close the user definition and the Nix expression [2].

Note that this is just an example, and you may need to modify it to fit your specific use case. Also, make sure to replace `exampleUser` with the actual username of the user you want to configure Doom Emacs for.