about summary refs log tree commit diff
path: root/modules/workstation/emacs/default.nix
blob: fa26e98ce64e4164f1f8cd4d2718547efb8d33ef (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
70
71
72
73
74
75
76
77
78
79
80
81
82
{ config, pkgs, ... }:

let
  emacs = ((with pkgs; emacsPackagesFor (emacs29-pgtk.overrideAttrs (
    { patches ? [], ... }:
    {
      patches = patches ++ [
        (fetchpatch {
          url = "https://git.savannah.gnu.org/cgit/emacs.git/patch/?id=e4e89e2cb663c730fd563d89228fe3a9a34e63e5";
          hash = "sha256-/7vWMFXjmmmTg6nNvEPOM3LkZ+j3IVV9W127anx5deI=";
        })
      ];
    }
  ))).emacsWithPackages (epkgs: with epkgs; [
    adoc-mode
    cmake-mode
    code-review
    csharp-mode
    d-mode
    direnv
    dockerfile-mode
    dts-mode
    ebuild-mode
    editorconfig
    eglot
    elpher
    execline
    forge
    gn-mode
    gnuplot-mode
    go-mode
    graphql-mode
    graphviz-dot-mode
    groovy-mode
    haskell-mode
    jam-mode
    just-mode
    kotlin-mode
    lua-mode
    magit
    markdown-mode
    meson-mode
    monokai-theme
    mutt-mode
    ninja-mode
    nix-mode
    notmuch
    org-roam
    pass
    pod-mode
    protobuf-mode
    rainbow-delimiters
    rust-mode
    sdlang-mode
    sort-words
    toml-mode
    tuareg
    typescript-mode
    udev-mode
    vala-mode
    yaml-mode
    zig-mode
  ]));
in

{
  environment.systemPackages = [ emacs ];

  systemd.tmpfiles.rules = [
    "d ${config.users.users.qyliss.home}/notes 0700 qyliss qyliss"
  ];

  users.users.qyliss.xdg.config.paths."emacs" = pkgs.runCommand ".emacs.d" {
    nativeBuildInputs = [ emacs ];
  } ''
    cp ${./early-init.el} early-init.el
    cp ${./init.el} init.el
    emacs -L . --batch -f batch-byte-compile *.el
    install -d $out
    install *.el *.elc $out
  '';
}