aboutsummaryrefslogtreecommitdiff
path: root/nix/users/fcuny/emacs.nix
blob: 9c3b73b5d55fb107319725d3fab30c2659f5925b (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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
{ pkgs, ... }:
let
  myEmacs = pkgs.emacsWithPackagesFromUsePackage {
    # TODO: https://github.com/NixOS/nixpkgs/issues/395169
    package = pkgs.emacs.override { withNativeCompilation = false; };
    config = ./configs/emacs/init.el;
    defaultInitFile = true;
    extraEmacsPackages =
      epkgs: with epkgs; [
        # completion
        cape
        consult
        corfu
        marginalia
        orderless
        vertico

        # development
        dape
        git-link
        direnv
        docker
        docker-compose-mode
        dockerfile-mode
        go-mode
        gotest
        hcl-mode
        jq-mode
        json-mode
        json-reformat
        magit
        nix-mode
        protobuf-mode
        terraform-mode
        toml-mode
        tree-sitter
        tree-sitter-langs
        treesit-grammars.with-all-grammars
        yaml-mode

        # misc
        ef-themes
        exec-path-from-shell
        rg
        yasnippet
        yasnippet-capf
      ];
  };
in
{
  home.file.".config/emacs/early-init.el".source = ./configs/emacs/early-init.el;
  home.file.".config/emacs/init.el".source = ./configs/emacs/init.el;

  programs.emacs = {
    enable = true;
    package = myEmacs;
  };

  home.packages = with pkgs; [
    aspell
    aspellDicts.en
    aspellDicts.en-science
    aspellDicts.en-computers
  ];

  home.sessionVariables = {
    EDITOR = "emacsclient -t";
  };
}