tvl-depot/users/sterni/emacs/default.nix
sterni f3cc32bef8 feat(users/sterni/emacs): enable paredit
Change-Id: I318ccf75fa470f442c05df6ae6f8df8772a7c1d6
Reviewed-on: https://cl.tvl.fyi/c/depot/+/4951
Tested-by: BuildkiteCI
Reviewed-by: sterni <sternenseemann@systemli.org>
Autosubmit: sterni <sternenseemann@systemli.org>
2022-01-17 12:19:53 +00:00

69 lines
1.8 KiB
Nix

{ depot, pkgs, ... }:
let
inherit (pkgs.emacsGcc.pkgs) withPackages;
emacs = withPackages (epkgs: [
# basic setup
epkgs.elpaPackages.undo-tree
epkgs.melpaPackages.evil
epkgs.melpaPackages.evil-collection
epkgs.melpaPackages.use-package
# languages
epkgs.bqn-mode
epkgs.elpaPackages.ada-mode
epkgs.melpaPackages.adoc-mode
epkgs.melpaPackages.dockerfile-mode
epkgs.melpaPackages.haskell-mode
epkgs.melpaPackages.jq-mode
epkgs.melpaPackages.languagetool
epkgs.melpaPackages.markdown-mode
epkgs.melpaPackages.nix-mode
epkgs.melpaPackages.sly
epkgs.melpaPackages.yaml-mode
epkgs.rust-mode
epkgs.urweb-mode
# misc
epkgs.melpaPackages.hl-todo
epkgs.melpaPackages.paredit
epkgs.elpaPackages.rainbow-mode
epkgs.melpaPackages.rainbow-delimiters
# beyond text editing
epkgs.melpaPackages.elfeed
epkgs.melpaPackages.magit
epkgs.tvlPackages.tvl
]);
configDirectory = pkgs.symlinkJoin {
name = "emacs.d";
paths = [
./.
(pkgs.writeTextFile {
name = "injected-emacs.d";
destination = "/nix-inject.el";
text = ''
;; bqn-mode
(setq bqn-interpreter-path "${pkgs.cbqn}/bin/BQN")
;; languagetool
(setq languagetool-java-bin "${pkgs.jre}/bin/java")
(setq languagetool-language-tool-jar "${pkgs.languagetool}/share/languagetool-commandline.jar")
(provide 'nix-inject)
'';
})
];
postBuild = ''
rm "$out/default.nix"
'';
};
in
# sadly we can't give an init-file via the command line
pkgs.writeShellScriptBin "emacs" ''
exec ${emacs}/bin/emacs \
--no-init-file \
--directory ${configDirectory} \
--eval "(require 'init)" \
"$@"
''