2022-01-18 21:06:26 +01:00
|
|
|
{ depot, pkgs, lib, ... }:
|
2020-01-06 15:58:22 +01:00
|
|
|
|
2021-12-20 03:58:40 +01:00
|
|
|
# TODO(wpcarro): See if it's possible to expose emacsclient on PATH, so that I
|
|
|
|
# don't need to depend on wpcarros-emacs and emacs in my NixOS configurations.
|
2020-01-06 15:58:22 +01:00
|
|
|
let
|
2022-03-13 17:19:07 +01:00
|
|
|
inherit (depot.third_party.nixpkgs) emacsPackagesFor emacs27;
|
2021-12-25 00:44:36 +01:00
|
|
|
inherit (depot.users) wpcarro;
|
2022-01-18 21:06:26 +01:00
|
|
|
inherit (lib) mapAttrsToList;
|
|
|
|
inherit (lib.strings) concatStringsSep makeBinPath;
|
2022-01-28 07:21:37 +01:00
|
|
|
inherit (pkgs) runCommand writeShellScriptBin;
|
2020-08-31 12:31:00 +02:00
|
|
|
|
2021-12-25 00:44:36 +01:00
|
|
|
emacsBinPath = makeBinPath (
|
|
|
|
wpcarro.common.shell-utils ++
|
|
|
|
(with pkgs; [
|
|
|
|
clipmenu
|
|
|
|
ispell
|
|
|
|
nix
|
|
|
|
pass
|
|
|
|
scrot
|
|
|
|
xorg.xset
|
|
|
|
])
|
|
|
|
);
|
2020-04-02 15:37:47 +02:00
|
|
|
|
2022-03-13 17:19:07 +01:00
|
|
|
emacsWithPackages = (emacsPackagesFor emacs27).emacsWithPackages;
|
2020-04-02 15:37:47 +02:00
|
|
|
|
2020-01-06 15:58:22 +01:00
|
|
|
wpcarrosEmacs = emacsWithPackages (epkgs:
|
2021-12-16 06:13:47 +01:00
|
|
|
(with epkgs.tvlPackages; [
|
|
|
|
tvl
|
|
|
|
]) ++
|
|
|
|
|
2020-01-06 15:58:22 +01:00
|
|
|
(with epkgs.elpaPackages; [
|
|
|
|
exwm
|
|
|
|
]) ++
|
|
|
|
|
|
|
|
(with epkgs.melpaPackages; [
|
2022-02-13 20:04:54 +01:00
|
|
|
avy
|
2020-08-19 17:16:31 +02:00
|
|
|
org-bullets
|
|
|
|
sly
|
2020-03-06 12:25:54 +01:00
|
|
|
notmuch
|
2020-04-11 18:45:59 +02:00
|
|
|
elm-mode
|
2020-02-10 12:34:19 +01:00
|
|
|
ts
|
2020-02-08 17:00:31 +01:00
|
|
|
vterm
|
2020-01-06 15:58:22 +01:00
|
|
|
base16-theme
|
2020-09-02 15:05:20 +02:00
|
|
|
password-store
|
2021-12-25 16:37:18 +01:00
|
|
|
# TODO(wpcarro): Prefer an Emacs client for clipmenud.
|
|
|
|
clipmon
|
2020-01-06 15:58:22 +01:00
|
|
|
evil
|
|
|
|
evil-collection
|
|
|
|
evil-commentary
|
|
|
|
evil-surround
|
|
|
|
key-chord
|
2021-12-25 16:37:18 +01:00
|
|
|
# TODO(wpcarro): Assess whether or not I need this with Nix.
|
|
|
|
add-node-modules-path
|
2020-01-06 15:58:22 +01:00
|
|
|
web-mode
|
|
|
|
rjsx-mode
|
|
|
|
tide
|
|
|
|
prettier-js
|
|
|
|
flycheck
|
|
|
|
diminish
|
|
|
|
doom-themes
|
2020-07-06 12:11:08 +02:00
|
|
|
telephone-line
|
2020-01-06 15:58:22 +01:00
|
|
|
which-key
|
2020-11-12 12:20:27 +01:00
|
|
|
all-the-icons
|
|
|
|
all-the-icons-ivy
|
2020-01-06 15:58:22 +01:00
|
|
|
ivy
|
2022-02-14 22:55:20 +01:00
|
|
|
ivy-clipmenu
|
2020-11-12 12:20:27 +01:00
|
|
|
ivy-pass
|
|
|
|
ivy-prescient
|
2020-01-31 13:45:48 +01:00
|
|
|
restclient
|
|
|
|
package-lint
|
|
|
|
parsec
|
|
|
|
magit-popup
|
|
|
|
direnv
|
2020-01-06 15:58:22 +01:00
|
|
|
alert
|
|
|
|
nix-mode
|
|
|
|
racer
|
|
|
|
rust-mode
|
|
|
|
rainbow-delimiters
|
|
|
|
racket-mode
|
|
|
|
lispyville
|
|
|
|
elisp-slime-nav
|
|
|
|
py-yapf
|
|
|
|
reason-mode
|
|
|
|
elixir-mode
|
2020-02-05 18:55:38 +01:00
|
|
|
go-mode
|
2020-01-06 15:58:22 +01:00
|
|
|
company
|
|
|
|
markdown-mode
|
|
|
|
refine
|
|
|
|
deferred
|
|
|
|
magit
|
|
|
|
request
|
|
|
|
pcre2el
|
|
|
|
helpful
|
2021-12-25 16:37:18 +01:00
|
|
|
# TODO(wpcarro): Determine if Nix solves this problem.
|
|
|
|
exec-path-from-shell
|
2020-01-06 15:58:22 +01:00
|
|
|
yasnippet
|
|
|
|
projectile
|
|
|
|
deadgrep
|
|
|
|
counsel
|
|
|
|
counsel-projectile
|
2021-12-25 16:37:18 +01:00
|
|
|
# TODO(wpcarro): Learn what this is.
|
|
|
|
engine-mode
|
2020-01-06 15:58:22 +01:00
|
|
|
eglot
|
|
|
|
dap-mode
|
|
|
|
lsp-ui
|
|
|
|
suggest
|
|
|
|
paradox
|
|
|
|
flymake-shellcheck
|
|
|
|
fish-mode
|
|
|
|
tuareg
|
|
|
|
haskell-mode
|
|
|
|
use-package
|
|
|
|
general
|
|
|
|
clojure-mode
|
|
|
|
cider
|
|
|
|
f
|
|
|
|
dash
|
|
|
|
company
|
|
|
|
counsel
|
|
|
|
flycheck
|
2021-12-25 01:25:18 +01:00
|
|
|
emojify
|
2020-01-06 15:58:22 +01:00
|
|
|
]));
|
|
|
|
|
2020-09-07 11:52:54 +02:00
|
|
|
loadPath = concatStringsSep ":" [
|
2022-01-28 07:15:40 +01:00
|
|
|
./.emacs.d/wpc
|
2021-12-25 16:37:18 +01:00
|
|
|
# TODO(wpcarro): Explain why the trailing ":" is needed.
|
2020-09-07 11:52:54 +02:00
|
|
|
"${wpcarrosEmacs.deps}/share/emacs/site-lisp:"
|
|
|
|
];
|
|
|
|
|
2022-01-18 21:06:26 +01:00
|
|
|
# Transform an attrset into "export k=v" statements.
|
|
|
|
makeEnvVars = env: concatStringsSep "\n"
|
|
|
|
(mapAttrsToList (k: v: "export ${k}=\"${v}\"") env);
|
|
|
|
|
2022-01-28 07:21:37 +01:00
|
|
|
withEmacsPath = { emacsBin, env ? { }, load ? [ ] }:
|
2020-08-31 12:31:00 +02:00
|
|
|
writeShellScriptBin "wpcarros-emacs" ''
|
2020-08-31 02:16:31 +02:00
|
|
|
export XMODIFIERS=emacs
|
|
|
|
export PATH="${emacsBinPath}:$PATH"
|
2020-09-07 11:52:54 +02:00
|
|
|
export EMACSLOADPATH="${loadPath}"
|
2022-01-18 21:06:26 +01:00
|
|
|
${makeEnvVars env}
|
2020-08-31 02:16:31 +02:00
|
|
|
exec ${emacsBin} \
|
|
|
|
--debug-init \
|
2020-11-12 12:20:27 +01:00
|
|
|
--no-init-file \
|
2020-08-31 02:16:31 +02:00
|
|
|
--no-site-file \
|
|
|
|
--no-site-lisp \
|
2022-01-28 07:15:40 +01:00
|
|
|
--load ${./.emacs.d/init.el} \
|
2022-01-31 21:58:04 +01:00
|
|
|
${concatStringsSep "\n " (map (el: "--load ${el} \\") load)}
|
2020-08-31 02:16:31 +02:00
|
|
|
"$@"
|
|
|
|
'';
|
2022-01-28 20:55:27 +01:00
|
|
|
in
|
|
|
|
{
|
|
|
|
inherit withEmacsPath;
|
|
|
|
|
2022-01-28 07:21:37 +01:00
|
|
|
nixos = { load ? [ ] }: withEmacsPath {
|
|
|
|
inherit load;
|
2020-08-31 02:16:31 +02:00
|
|
|
emacsBin = "${wpcarrosEmacs}/bin/emacs";
|
|
|
|
};
|
2021-12-24 00:30:31 +01:00
|
|
|
|
2022-01-28 21:40:11 +01:00
|
|
|
# Script that asserts my Emacs can initialize without warnings or errors.
|
|
|
|
check = runCommand "check-emacs" { } ''
|
|
|
|
# Even though Buildkite defines this, I'd still like still be able to test
|
|
|
|
# this locally without depending on my ability to remember to set CI=true.
|
|
|
|
export CI=true
|
|
|
|
export PATH="${emacsBinPath}:$PATH"
|
|
|
|
export EMACSLOADPATH="${loadPath}"
|
|
|
|
${wpcarrosEmacs}/bin/emacs \
|
|
|
|
--no-site-file \
|
|
|
|
--no-site-lisp \
|
|
|
|
--no-init-file \
|
|
|
|
--script ${./ci.el} \
|
|
|
|
${./.emacs.d/init.el} && \
|
|
|
|
touch $out
|
|
|
|
'';
|
|
|
|
|
2022-02-08 00:27:26 +01:00
|
|
|
meta.ci.targets = [ "check" ];
|
2020-04-02 15:37:47 +02:00
|
|
|
}
|