summaryrefslogtreecommitdiff
path: root/common/modules/emacs/default.nix
blob: 4566f5729b462f1ed1b88c2be1a2b3c5eb6709f7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
{
  homeManager,
  inputs,
  moduleNameSpace,
  ...
}:
{
  pkgs,
  config,
  lib,
  ...
}:
let
  cfg = config.${moduleNameSpace}.emacs;
in
{
  imports = lib.optionals homeManager [
    inputs.nix-doom-emacs-unstraightened.homeModule
  ];

  options.${moduleNameSpace}.emacs = {
    enable = lib.mkEnableOption "Enable emacs";
  };

  config = lib.mkIf cfg.enable (
    lib.optionalAttrs homeManager {
      programs.doom-emacs = {
        enable = true;
        doomDir = ./doom; # or e.g. `./doom.d` for a local configuration
      };
    }
  );
}