dotfiles/home-manager/modules/emacs/default.nix

94 lines
2.3 KiB
Nix
Raw Normal View History

{
pkgs,
config,
lib,
secret,
inputs',
...
}: {
home.packages = with pkgs; [
(makeDesktopItem {
name = "Org-Protocol";
exec = "emacsclient %u";
comment = "Org protocol";
desktopName = "org-protocol";
type = "Application";
mimeTypes = ["x-scheme-handler/org-protocol"];
})
emacs-master-nativecomp
(iosevka-bin.override {variant = "Aile";})
(iosevka-bin.override {variant = "Etoile";})
(iosevka-bin.override {variant = "";})
(nerdfonts.override {fonts = ["NerdFontsSymbolsOnly"];})
];
systemd.user.services.emacs = {
Unit = {
Description = "Emacs, the extensible editor";
After = ["graphical-session-pre.target"];
PartOf = ["graphical-session.target"];
};
Service = {
Type = "simple";
ExecStart = ''/bin/sh -l -c "emacs --fg-daemon"'';
};
Install = {WantedBy = ["graphical-session.target"];};
};
home.file = {
".emacs".source = ./.emacs;
".mbsyncrc".source = secret.emacs.mbsyncrc or ./.;
".emacs.d/org" = {
source = ./.emacs.d/org;
recursive = true;
};
".emacs.d/lisp" = {
source = ./.emacs.d/lisp;
recursive = true;
};
".emacs.d/mu4e-contexts".source = secret.emacs.mu4eContexts or ./.;
".emacs.d/tree-sitter".source = pkgs.tree-sitter-grammars;
".emacs.d/vterm-module".source = pkgs.stdenv.mkDerivation {
name = "vterm-emacs";
src = inputs'.vtermModule;
buildInputs = with pkgs; [cmake libtool glib.dev libvterm-neovim];
cmakeFlags = [
"-DEMACS_SOURCE=${inputs'.emacs}"
"-DUSE_SYSTEM_LIBVTERM=ON"
];
installPhase = ''
mkdir -p $out/lib
install ../vterm-module.so $out/lib
'';
};
".emacs.d/profile".source = pkgs.buildEnv {
name = "emacs-env";
paths = with pkgs; [
emacsPackages.pdf-tools
cmake
ninja
gnumake
gcc
mu
mu.mu4e
ripgrep
fd
isync
imagemagick
texlive.combined.scheme-full
(hunspellWithDicts (with hunspellDicts; [
sk-sk
en-us
]))
ledger-compat
python311Packages.pygments
hledger
(rWrapper.override {packages = with rPackages; [ggplot2 ascii car];})
xclip
];
};
};
}