2021-08-19 16:19:21 +02:00
|
|
|
{ depot, pkgs, ... }:
|
|
|
|
|
|
|
|
let
|
2022-05-04 15:16:36 +02:00
|
|
|
inherit (pkgs.emacsNativeComp.pkgs) withPackages;
|
2021-08-19 16:19:21 +02:00
|
|
|
|
|
|
|
emacs = withPackages (epkgs: [
|
2021-09-06 16:24:00 +02:00
|
|
|
epkgs.bqn-mode
|
2021-08-19 16:19:21 +02:00
|
|
|
epkgs.elpaPackages.ada-mode
|
2022-05-09 15:11:04 +02:00
|
|
|
epkgs.elpaPackages.rainbow-mode
|
|
|
|
epkgs.elpaPackages.undo-tree
|
2021-08-19 16:19:21 +02:00
|
|
|
epkgs.melpaPackages.adoc-mode
|
2022-05-09 15:37:24 +02:00
|
|
|
epkgs.melpaPackages.cmake-mode
|
2022-03-12 13:33:55 +01:00
|
|
|
epkgs.melpaPackages.direnv
|
2021-08-19 16:19:21 +02:00
|
|
|
epkgs.melpaPackages.dockerfile-mode
|
2022-05-12 18:33:50 +02:00
|
|
|
epkgs.melpaPackages.editorconfig
|
2022-05-09 15:11:04 +02:00
|
|
|
epkgs.melpaPackages.elfeed
|
|
|
|
epkgs.melpaPackages.evil
|
|
|
|
epkgs.melpaPackages.evil-collection
|
2021-08-19 16:19:21 +02:00
|
|
|
epkgs.melpaPackages.haskell-mode
|
2022-05-09 15:11:04 +02:00
|
|
|
epkgs.melpaPackages.hl-todo
|
2021-10-11 15:02:19 +02:00
|
|
|
epkgs.melpaPackages.jq-mode
|
2022-01-11 00:21:21 +01:00
|
|
|
epkgs.melpaPackages.languagetool
|
2022-03-12 13:33:55 +01:00
|
|
|
epkgs.melpaPackages.lsp-haskell
|
2022-05-09 15:11:04 +02:00
|
|
|
epkgs.melpaPackages.lsp-mode
|
|
|
|
epkgs.melpaPackages.magit
|
2021-08-19 16:19:21 +02:00
|
|
|
epkgs.melpaPackages.markdown-mode
|
2022-05-02 23:12:49 +02:00
|
|
|
epkgs.melpaPackages.meson-mode
|
2021-08-19 16:19:21 +02:00
|
|
|
epkgs.melpaPackages.nix-mode
|
2022-05-11 19:35:37 +02:00
|
|
|
epkgs.melpaPackages.org-clock-csv
|
2022-05-09 15:11:04 +02:00
|
|
|
epkgs.melpaPackages.paredit
|
|
|
|
epkgs.melpaPackages.rainbow-delimiters
|
2021-08-19 16:19:21 +02:00
|
|
|
epkgs.melpaPackages.sly
|
2022-05-09 15:11:04 +02:00
|
|
|
epkgs.melpaPackages.use-package
|
2021-08-19 16:19:21 +02:00
|
|
|
epkgs.melpaPackages.yaml-mode
|
2021-09-14 23:38:42 +02:00
|
|
|
epkgs.rust-mode
|
2021-08-19 16:19:21 +02:00
|
|
|
epkgs.tvlPackages.tvl
|
2022-05-09 15:11:04 +02:00
|
|
|
epkgs.urweb-mode
|
2021-08-19 16:19:21 +02:00
|
|
|
]);
|
2021-12-14 15:36:20 +01:00
|
|
|
|
|
|
|
configDirectory = pkgs.symlinkJoin {
|
|
|
|
name = "emacs.d";
|
|
|
|
paths = [
|
|
|
|
./.
|
|
|
|
(pkgs.writeTextFile {
|
|
|
|
name = "injected-emacs.d";
|
|
|
|
destination = "/nix-inject.el";
|
|
|
|
text = ''
|
2022-01-11 00:21:21 +01:00
|
|
|
;; bqn-mode
|
2021-12-14 15:36:20 +01:00
|
|
|
(setq bqn-interpreter-path "${pkgs.cbqn}/bin/BQN")
|
|
|
|
|
2022-01-11 00:21:21 +01:00
|
|
|
;; languagetool
|
2022-03-06 23:48:51 +01:00
|
|
|
(setq languagetool-java-bin "${pkgs.jre}/bin/java"
|
|
|
|
languagetool-console-command "${pkgs.languagetool}/share/languagetool-commandline.jar"
|
|
|
|
languagetool-server-command "${pkgs.languagetool}/share/languagetool-server.jar"
|
|
|
|
languagetool-java-arguments '("-Dfile.encoding=UTF-8"))
|
2022-01-11 00:21:21 +01:00
|
|
|
|
2022-05-10 16:13:22 +02:00
|
|
|
;; use bash instead of fish from SHELL for some things, as it plays
|
|
|
|
;; nicer with TERM=dumb, as I don't need/want vterm anyways.
|
|
|
|
;; We want it to source /etc/profile for some extra setup that
|
|
|
|
;; kicks in if TERM=dumb, meaning we can't use dash/sh mode.
|
|
|
|
(setq shell-file-name "${pkgs.bash}/bin/bash"
|
|
|
|
explicit-bash-args '("-l"))
|
|
|
|
|
2021-12-14 15:36:20 +01:00
|
|
|
(provide 'nix-inject)
|
|
|
|
'';
|
|
|
|
})
|
|
|
|
];
|
|
|
|
postBuild = ''
|
|
|
|
rm "$out/default.nix"
|
|
|
|
'';
|
|
|
|
};
|
2021-08-19 16:19:21 +02:00
|
|
|
in
|
|
|
|
|
|
|
|
# sadly we can't give an init-file via the command line
|
2022-03-24 11:27:21 +01:00
|
|
|
(pkgs.writeShellScriptBin "emacs" ''
|
2021-12-14 15:36:20 +01:00
|
|
|
exec ${emacs}/bin/emacs \
|
|
|
|
--no-init-file \
|
|
|
|
--directory ${configDirectory} \
|
|
|
|
--eval "(require 'init)" \
|
2021-08-19 16:19:21 +02:00
|
|
|
"$@"
|
2022-03-24 11:27:21 +01:00
|
|
|
'').overrideAttrs (super: {
|
|
|
|
buildCommand = ''
|
|
|
|
${super.buildCommand}
|
|
|
|
|
|
|
|
ln -s "${emacs}/bin/emacsclient" "$out/bin/emacsclient"
|
|
|
|
'';
|
|
|
|
})
|