~ruther/nixos-config

ref: 83a8a9540adf86155220703b70c5fbdc9c6c3def nixos-config/modules/editors/emacs/home.nix -rw-r--r-- 1.5 KiB
83a8a954 — Frantisek Bohacek feat: some updates 1 year, 3 days ago
                                                                                
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
70
71
#
# Personal Emacs config. Can be set up with vanilla nixos or with home-manager (see comments at bottom)
#
# flake.nix
#   ├─ ./hosts
#   │   └─ configuration.nix
#   └─ ./modules
#       └─ ./editors
#           └─ ./emacs
#               └─ default.nix *
#


{ config, user, unstable, pkgs, inputs, location, ... }:

let
  doomRev = "844a82c";
in {
  services.emacs = {
    enable = true;
    client = {
      enable = true;
    };
    startWithUserSession = "graphical";
  };

  programs.emacs = {
    enable = true;
    package = pkgs.emacs29-gtk3;
    extraPackages = epkgs: [
      epkgs.vterm
      epkgs.sqlite
      epkgs.treesit-grammars.with-all-grammars
    ];
  };

  home.activation = {
    linkDoomConfig = {
      after = [ "writeBoundary" "createXdgUserDirectories" ];
      before = [  ];
      data =
        ''
            EMACS=$HOME/.emacs.d
            if [ ! -d "$EMACS" ]; then
              ${pkgs.git}/bin/git clone https://github.com/doomemacs/doomemacs $EMACS
              (cd $EMACS && ${pkgs.git}/bin/git checkout ${doomRev})
            fi
            if [ ! -d "$HOME/.doom.d" ]; then
                ln -s ${location}/modules/editors/emacs/doom.d $HOME/.doom.d
            fi
        '';
    };
  };

  home.packages = with pkgs; [
    emacs-all-the-icons-fonts
    #binutils # for native comp

    ## Doom emacs dependencies
    gnutls
    fd
    ripgrep

    delta

    ## Optional dependencies
    fd
    imagemagick
    #zstd
  ];
}
Do not follow this link