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-04-21 16:36:04 +02:00
|
|
|
inherit (depot.third_party.nixpkgs) emacsPackagesFor emacs28;
|
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 ++
|
2022-08-08 19:53:23 +02:00
|
|
|
# Rust dependencies
|
|
|
|
(with pkgs; [
|
|
|
|
cargo
|
|
|
|
rls
|
|
|
|
rust-analyzer
|
|
|
|
rustc
|
|
|
|
rustfmt
|
|
|
|
]) ++
|
|
|
|
# Misc dependencies
|
2021-12-25 00:44:36 +01:00
|
|
|
(with pkgs; [
|
|
|
|
ispell
|
|
|
|
nix
|
|
|
|
pass
|
2022-08-07 21:50:29 +02:00
|
|
|
rls # Rust Language Server
|
|
|
|
rust-analyzer
|
2022-08-07 06:17:06 +02:00
|
|
|
rustc
|
|
|
|
rustfmt
|
2021-12-25 00:44:36 +01:00
|
|
|
scrot
|
|
|
|
xorg.xset
|
2022-01-30 17:06:58 +01:00
|
|
|
])
|
|
|
|
);
|
2020-04-02 15:37:47 +02:00
|
|
|
|
2022-04-21 16:36:04 +02:00
|
|
|
emacsWithPackages = (emacsPackagesFor emacs28).emacsWithPackages;
|
2020-04-02 15:37:47 +02:00
|
|
|
|
2020-01-06 15:58:22 +01:00
|
|
|
wpcarrosEmacs = emacsWithPackages (epkgs:
|
2022-07-22 04:55:39 +02:00
|
|
|
(with wpcarro.emacs.pkgs; [
|
2022-07-29 05:29:07 +02:00
|
|
|
al
|
2022-07-30 06:12:59 +02:00
|
|
|
cycle
|
2022-07-29 05:29:07 +02:00
|
|
|
list
|
2022-07-29 20:15:17 +02:00
|
|
|
maybe
|
2022-07-29 05:29:07 +02:00
|
|
|
set
|
2022-07-30 03:56:06 +02:00
|
|
|
string
|
2022-07-29 05:29:07 +02:00
|
|
|
struct
|
2022-07-30 19:43:06 +02:00
|
|
|
symbol
|
2022-07-30 20:19:43 +02:00
|
|
|
vterm-mgt
|
2022-07-22 04:55:39 +02:00
|
|
|
zle
|
|
|
|
]) ++
|
|
|
|
|
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
|
2022-05-09 17:17:21 +02:00
|
|
|
csharp-mode
|
2022-04-15 19:34:00 +02:00
|
|
|
dockerfile-mode
|
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
|
|
|
|
rust-mode
|
|
|
|
rainbow-delimiters
|
|
|
|
racket-mode
|
|
|
|
lispyville
|
|
|
|
elisp-slime-nav
|
|
|
|
py-yapf
|
|
|
|
reason-mode
|
2022-05-09 19:40:59 +02:00
|
|
|
terraform-mode
|
2020-01-06 15:58:22 +01:00
|
|
|
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
|
2022-04-15 19:34:00 +02:00
|
|
|
yaml-mode
|
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-30 17:06:58 +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-30 17:06:58 +01:00
|
|
|
in
|
|
|
|
{
|
2022-01-28 20:55:27 +01:00
|
|
|
inherit withEmacsPath;
|
|
|
|
|
2022-01-30 17:06:58 +01:00
|
|
|
nixos = { load ? [ ] }: withEmacsPath {
|
2022-01-28 07:21:37 +01:00
|
|
|
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.
|
2022-01-30 17:06:58 +01:00
|
|
|
check = runCommand "check-emacs" { } ''
|
2022-01-28 21:40:11 +01:00
|
|
|
# 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
|
|
|
}
|