2022-10-06 23:37:18 +02:00
|
|
|
{ depot, pkgs, lib, ... }:
|
2021-08-19 16:19:21 +02:00
|
|
|
|
|
|
|
let
|
2022-10-06 23:37:18 +02:00
|
|
|
inherit (pkgs.stdenv.hostPlatform) is64bit;
|
|
|
|
|
2023-03-27 19:24:55 +02:00
|
|
|
# Wrap chktex(1) with the flags we want because the chktex flycheck checker
|
|
|
|
# ignores tex-chktex-extra-flags and has no other way to set flags. I did
|
|
|
|
# not want to mess around with chktexrc because that seems to involve copying
|
|
|
|
# around a lot of rules (that would need to be updated?).
|
|
|
|
#
|
|
|
|
# Warning 8 is about correct dash length. This is really annoying because it'll
|
|
|
|
# light up everywhere if you use typographically correct dashes in German text.
|
|
|
|
chktexLessWarnings = pkgs.writeShellScript "chktex-less-warnings" ''
|
|
|
|
exec chktex -n8 "$@"
|
|
|
|
'';
|
|
|
|
|
2022-12-12 10:48:21 +01:00
|
|
|
# emacsPgtk is defined in emacs-overlay
|
|
|
|
emacs = (pkgs.emacsPackagesFor pkgs.emacsPgtk).withPackages (epkgs: [
|
2022-09-17 20:36:24 +02:00
|
|
|
epkgs.bqn-mode
|
2022-05-22 13:33:17 +02:00
|
|
|
#epkgs.elpaPackages.ada-mode
|
2022-05-09 15:11:04 +02:00
|
|
|
epkgs.elpaPackages.rainbow-mode
|
|
|
|
epkgs.elpaPackages.undo-tree
|
2022-05-25 09:24:46 +02:00
|
|
|
epkgs.elpaPackages.which-key
|
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
|
2022-12-23 15:23:29 +01:00
|
|
|
epkgs.melpaPackages.flycheck
|
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-03-12 13:33:55 +01:00
|
|
|
epkgs.melpaPackages.lsp-haskell
|
2022-05-09 15:11:04 +02:00
|
|
|
epkgs.melpaPackages.lsp-mode
|
2022-05-26 13:42:52 +02:00
|
|
|
epkgs.melpaPackages.lsp-ui
|
2022-05-09 15:11:04 +02:00
|
|
|
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
|
2022-10-06 23:37:18 +02:00
|
|
|
] ++ lib.optionals is64bit [
|
|
|
|
epkgs.melpaPackages.languagetool
|
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";
|
2022-10-07 02:36:52 +02:00
|
|
|
text =
|
|
|
|
# Java doesn't seem to be available for non 64bit platforms in nixpkgs
|
|
|
|
# CBQN doesn't seem to support i686 at least
|
|
|
|
lib.optionalString is64bit ''
|
|
|
|
;; bqn-mode
|
|
|
|
(setq bqn-interpreter-path "${pkgs.cbqn}/bin/BQN")
|
2021-12-14 15:36:20 +01:00
|
|
|
|
2022-10-07 02:36:52 +02:00
|
|
|
;; languagetool
|
|
|
|
(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")
|
2022-10-06 23:37:18 +02:00
|
|
|
'' + ''
|
2022-01-11 00:21:21 +01:00
|
|
|
|
2022-10-07 02:36:52 +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"))
|
2022-05-10 16:13:22 +02:00
|
|
|
|
2023-03-27 19:24:55 +02:00
|
|
|
;; chktex wrapper that disables warnings I don't want
|
|
|
|
(setq flycheck-tex-chktex-executable "${chktexLessWarnings}")
|
|
|
|
(setq tex-chktex-program "${chktexLessWarnings}")
|
|
|
|
|
2022-10-07 02:36:52 +02:00
|
|
|
(provide 'nix-inject)
|
2021-12-14 15:36:20 +01:00
|
|
|
'';
|
|
|
|
})
|
|
|
|
];
|
|
|
|
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"
|
|
|
|
'';
|
|
|
|
})
|