about summary refs log tree commit diff
path: root/modules/nixos/emacs.nix
blob: e348398e576cbf2a4b5827db54217252ccc330b0 (plain) (blame)
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.emacs.extraConfig = mkAfter ''
        (appendq! auth-sources '("${config.secrets.authinfo.path}"))
      '';

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

Consider giving Nix/NixOS a try! <3