System/home-manager/common/programs/emacs.nix

71 lines
1.8 KiB
Nix

{ config, lib, pkgs, inputs, ... }:
{
config = lib.mkMerge [
(lib.mkIf config.nathan.programs.emacs.enable (let
myAspell = pkgs.aspellWithDicts (d: [ d.en d.en-science d.en-computers ]);
in {
# Dependencies of my emacs environment
home.packages = with pkgs; [
# For markdown rendering
python39Packages.grip
# For graph generation
graphviz
sqlite
plantuml
# For latex editing
texlive.combined.scheme-medium
# For notifications
libnotify
# For spelling
myAspell
# For nix
rnix-lsp
manix
nix-doc
nixfmt
# For email
inputs.nixpkgs-unstable.legacyPackages.${pkgs.system}.mu
meson
pkg-config
glib
# Desktop file for org-protocol
(makeDesktopItem {
name = "org-protocol";
exec = "emacsclient %u";
comment = "Org protocol";
desktopName = "org-protocol";
type = "Application";
mimeTypes = [ "x-scheme-handler/org-protocol" ];
})
# For format output
# wkhtmltopdf
];
programs.emacs = {
enable = true;
package = config.nathan.programs.emacs.package;
extraPackages = epkgs: [
inputs.nixpkgs-unstable.legacyPackages.${pkgs.system}.emacsPackages.mu4e
epkgs.vterm
epkgs.pdf-tools
epkgs.emacsql
epkgs.emacsql-sqlite
];
};
# Set emacs as the editor
home.sessionVariables = {
EDITOR = "emacsclient -c";
VISUAL = "emacsclient -c";
ALTERNATE_EDITOR = "";
};
}))
(lib.mkIf (config.nathan.programs.emacs.enable && pkgs.stdenv.isLinux) {
home.packages = with pkgs;
[
# For flash cards
anki
];
})
];
}