about summary refs log tree commit diff
path: root/emacs.nix
blob: 99c49fa334b350ebe743d8ec4bf9f4b6547d15b5 (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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# Derivation for Emacs configured with the packages that I need:

{ pkgs ? import <nixos> {} }:

let emacsWithPackages = with pkgs; (emacsPackagesNgGen emacs).emacsWithPackages;
sly = with pkgs; emacsPackagesNg.melpaBuild {
  pname   = "sly";
  version = "20180221.1414";

  src = fetchFromGitHub {
    owner  = "joaotavora";
    repo   = "sly";
    rev    = "486bfbe95612bcdc0960c490207970a188e0fbb9";
    sha256 = "0ib4q4k3h3qn88pymyjjmlmnpizdn1mfg5gpk5a715nqsgxlg09l";
  };

  recipeFile = fetchurl {
    url    = "https://raw.githubusercontent.com/melpa/melpa/23b9e64887a290fca7c7ab2718f627f8d728575f/recipes/sly";
    sha256 = "1pmyqjk8fdlzwvrlx8h6fq0savksfny78fhmr8r7b07pi20y6n9l";
    name   = "sly";
  };
};

# Building sly-company requires quite some dancing because
# company-mode is required at build time.
trivialBuildWithCompany = with pkgs; callPackage <nixos/pkgs/build-support/emacs/trivial.nix> {
  emacs = with pkgs; emacsWithPackages(epkgs: [ epkgs.elpaPackages.company ]);
};

sly-company = with pkgs; trivialBuildWithCompany {
  pname   = "sly-company";
  version = "master";

  src = fetchFromGitHub {
    owner  = "joaotavora";
    repo   = "sly-company";
    rev    = "dfe18218e4b2ee9874394b50f82f5172f41c462c";
    sha256 = "1bj8w2wfq944cnhsk5xx41mfrjv89scrg4w98kqgda5drkpdf8a7";
  };
};

# Custom code for packages missing from the current Nix packages.

in emacsWithPackages(epkgs:
  # Actual ELPA packages (the enlightened!)
  (with epkgs.elpaPackages; [
    ace-window
    adjust-parens
    avy
    company
    exwm
    pinentry
    rainbow-mode
    undo-tree
    which-key
  ]) ++

  # Stable packages:
  (with epkgs.melpaStablePackages; [
    browse-kill-ring
    cargo
    dash
    dash-functional
    dockerfile-mode
    erlang
    flycheck
    go-mode
    gruber-darker-theme
    haskell-mode
    helm
    ht
    idle-highlight-mode
    magit
    markdown-mode-plus
    multi-term
    multiple-cursors
    nix-mode
    paredit
    password-store
    racer
    rainbow-delimiters
    rust-mode
    s
    smart-mode-line
    string-edit
    terraform-mode
    yaml-mode
  ]) ++

  # Bleeding-edge packages:
  (with epkgs.melpaPackages; [
    helm-pass
    pg
    racket-mode
    restclient
    uuidgen
  ]) ++

  # Custom packaged Emacs packages:
  [ sly sly-company ]
)