helm/modules/editors/emacs.nix

81 lines
2.4 KiB
Nix
Raw Normal View History

2020-01-03 21:14:19 -08:00
# Emacs is my main driver. I'm the author of Doom Emacs
2020-01-12 15:17:17 -08:00
# https://github.com/hlissner/doom-emacs. This module sets it up to meet my
2020-01-03 21:14:19 -08:00
# particular Doomy needs.
2019-08-06 10:56:54 -07:00
2020-10-26 02:48:12 -07:00
{ config, lib, pkgs, inputs, ... }:
2020-03-28 22:48:43 -07:00
with lib;
with lib.my;
let cfg = config.modules.editors.emacs;
in {
2020-03-28 22:48:43 -07:00
options.modules.editors.emacs = {
enable = mkBoolOpt false;
doom = {
enable = mkBoolOpt true;
fromSSH = mkBoolOpt false;
2020-07-31 15:57:14 -07:00
};
2020-03-28 22:48:43 -07:00
};
config = mkIf cfg.enable {
nixpkgs.overlays = [ inputs.emacs-overlay.overlay ];
user.packages = with pkgs; [
2020-10-23 17:55:08 -07:00
## Emacs itself
2020-10-18 19:26:15 -07:00
binutils # native-comp needs 'as', provided by this
emacsPgtkGcc # 28 + pgtk + native-comp
2020-10-23 17:55:08 -07:00
## Doom dependencies
git
(ripgrep.override {withPCRE2 = true;})
gnutls # for TLS connectivity
2020-01-12 15:17:17 -08:00
## Optional dependencies
fd # faster projectile indexing
imagemagick # for image-dired
(mkIf (config.programs.gnupg.agent.enable)
pinentry_emacs) # in-emacs gnupg prompts
zstd # for undo-fu-session/undo-tree compression
2020-03-28 22:48:43 -07:00
## Module dependencies
# :checkers spell
(aspellWithDicts (ds: with ds; [
en en-computers en-science
]))
# :checkers grammar
languagetool
# :tools editorconfig
editorconfig-core-c # per-project style config
# :tools lookup & :lang org +roam
sqlite
# :lang cc
ccls
# :lang javascript
nodePackages.javascript-typescript-langserver
# :lang latex & :lang org (latex previews)
texlive.combined.scheme-medium
# :lang rust
rustfmt
unstable.rust-analyzer
2020-03-28 22:48:43 -07:00
];
env.PATH = [ "$XDG_CONFIG_HOME/emacs/bin" ];
modules.shell.zsh.rcFiles = [ "${configDir}/emacs/aliases.zsh" ];
fonts.fonts = [ pkgs.emacs-all-the-icons-fonts ];
# init.doomEmacs = mkIf cfg.doom.enable ''
# if [ -d $HOME/.config/emacs ]; then
# ${optionalString cfg.doom.fromSSH ''
# git clone git@github.com:hlissner/doom-emacs.git $HOME/.config/emacs
# git clone git@github.com:hlissner/doom-emacs-private.git $HOME/.config/doom
# ''}
# ${optionalString (cfg.doom.fromSSH == false) ''
# git clone https://github.com/hlissner/doom-emacs $HOME/.config/emacs
# git clone https://github.com/hlissner/doom-emacs-private $HOME/.config/doom
# ''}
# fi
# '';
2020-03-28 22:48:43 -07:00
};
2019-08-06 10:56:54 -07:00
}