about summary refs log tree commit diff
path: root/infra/nixos/emacs.nix
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@google.com>2019-12-14T11·44+0000
committerVincent Ambo <tazjin@google.com>2019-12-14T11·44+0000
commit3f199f96506d2559dd51d8fff629790e057c9149 (patch)
tree2ffdc8289f70568fa63ed97097d8da04ccaee989 /infra/nixos/emacs.nix
parent83f1b769fb433c1f3be1fe38c8d31910753a6123 (diff)
chore(nixos): Move NixOS config to infra/nixos
Diffstat (limited to 'infra/nixos/emacs.nix')
-rw-r--r--infra/nixos/emacs.nix138
1 files changed, 138 insertions, 0 deletions
diff --git a/infra/nixos/emacs.nix b/infra/nixos/emacs.nix
new file mode 100644
index 000000000000..24426bc4381c
--- /dev/null
+++ b/infra/nixos/emacs.nix
@@ -0,0 +1,138 @@
+# Derivation for Emacs pre-configured with packages that I need.
+#
+# TODO: Fix sly (again)
+
+{ pkgs }:
+
+with pkgs; with emacsPackagesNg;
+let emacsWithPackages = (emacsPackagesNgGen emacs).emacsWithPackages;
+
+# As the EXWM-README points out, XELB should be built from source if
+# EXWM is.
+xelb = melpaBuild {
+  pname   = "xelb";
+  ename   = "xelb";
+  version = "0.15";
+  recipe  = builtins.toFile "recipe" ''
+    (xelb :fetcher github
+          :repo "ch11ng/xelb")
+  '';
+
+  packageRequires = [ cl-generic emacs ];
+
+  src = fetchFromGitHub {
+    owner  = "ch11ng";
+    repo   = "xelb";
+    rev    = "b8f168b401977098fe2b30f4ca32629c0ab6eb83";
+    sha256 = "1ack1h68x8ia0ji6wbhmayrakq35p5sgrrl6qvha3ns3pswc0pl9";
+ };
+};
+
+# EXWM pinned to a newer version than what is released due to a
+# potential fix for ch11ng/exwm#425.
+exwm = melpaBuild {
+  pname   = "exwm";
+  ename   = "exwm";
+  version = "0.19";
+  recipe  = builtins.toFile "recipe" ''
+    (exwm :fetcher github
+          :repo "ch11ng/exwm")
+  '';
+
+  packageRequires = [ xelb ];
+
+  src = fetchFromGitHub {
+    owner  = "ch11ng";
+    repo   = "exwm";
+    rev    = "472f7cb82b67b98843f10c12e6bda9b8ae7262bc";
+    sha256 = "19gflsrb19aijf2xcw7j2m658qad21nbwziw38s1h2jw66vhk8dj";
+ };
+};
+
+slyFixed = sly.overrideAttrs(_: {
+  recipe = builtins.toFile "recipe" ''
+(sly :repo "joaotavora/sly"
+     :fetcher github
+     :files ("*.el"
+             ("lib" "lib/*")
+             ("contrib" "contrib/*")
+             "doc/*.texi"
+             "doc/*.info"
+             "doc/dir"))
+'';
+});
+
+in emacsWithPackages(epkgs:
+  # Actual ELPA packages (the enlightened!)
+  (with epkgs.elpaPackages; [
+    ace-window
+    avy
+    company
+    pinentry
+    rainbow-mode
+    undo-tree
+    which-key
+  ]) ++
+
+  # MELPA packages:
+  (with epkgs.melpaPackages; [
+    browse-kill-ring
+    cargo
+    counsel
+    counsel-notmuch
+    dash
+    dash-functional
+    dockerfile-mode
+    edit-server
+    eglot
+    elixir-mode
+    erlang
+    elm-mode
+    exwm
+    go-mode
+    gruber-darker-theme
+    haskell-mode
+    ht
+    hydra
+    idle-highlight-mode
+    intero
+    ivy
+    ivy-pass
+    ivy-prescient
+    jq-mode
+    kotlin-mode
+    magit
+    markdown-mode
+    markdown-toc
+    meghanada
+    multi-term
+    multiple-cursors
+    nginx-mode
+    nix-mode
+    omnisharp
+    paredit
+    password-store
+    pg
+    pkgs.notmuch
+    prescient
+    rainbow-delimiters
+    restclient
+    rust-mode
+    s
+    slyFixed
+    smartparens
+    string-edit
+    swiper
+    telephone-line
+    terraform-mode
+    toml-mode
+    use-package
+    uuidgen
+    web-mode
+    websocket
+    yaml-mode
+  ]) ++
+
+  # Custom packaged Emacs packages:
+  [ xelb exwm ]
+)