summaryrefslogtreecommitdiff
path: root/modules/nixos/emacs.nix
blob: 2db8120232414f300b7a7164540f1bcfaf6f97c5 (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
{
  config,
  inputs,
  lib,
  ...
}:
with lib; let
  cfg = config.nixfiles.modules.emacs;
in {
  config = mkIf cfg.enable {
    secrets.authinfo = {
      file = "${inputs.self}/secrets/authinfo";
      owner = my.username;
      inherit (config.my) group;
    };

    nixfiles.modules.x11.enable = true;

    hm = {
      programs.doom-emacs.extraConfig = mkAfter ''
        (appendq! auth-sources '("${config.secrets.authinfo.path}"))
      '';

      services.emacs = {
        enable = true;
        client.enable = true;
      };
    };
  };
}