nixos-config/configurations/profile/home/editor/emacs/default.nix

66 lines
1.5 KiB
Nix
Raw Normal View History

{ config, lib, pkgs, materusArg, ... }:
2023-10-08 11:42:08 +02:00
let
cfg = config.materus.profile.editor.emacs;
2023-11-04 10:50:50 +01:00
configPath = "${materusArg.cfg.path}" + "/extraFiles/config/emacs/";
2023-10-25 15:34:43 +02:00
emacsPkgs = with pkgs;[
python3
lua
];
2023-10-08 11:42:08 +02:00
in
{
options.materus.profile.editor.emacs.enable = materusArg.pkgs.lib.mkBoolOpt false "Enable emacs with materus cfg";
2023-10-08 11:42:08 +02:00
config = lib.mkIf cfg.enable {
2023-10-25 15:34:43 +02:00
programs.emacs = {
enable = true;
2023-11-05 11:59:54 +01:00
package = with pkgs; lib.mkDefault (if pkgs ? emacs-pgtk then emacs-pgtk else emacs29-gtk);
2023-10-25 15:34:43 +02:00
extraPackages = epkgs: with epkgs; [
evil
2023-10-25 19:28:25 +02:00
evil-numbers
evil-mc
evil-tex
evil-nerd-commenter
2023-11-04 10:50:50 +01:00
dashboard
2023-10-25 19:28:25 +02:00
magit
2023-10-25 15:34:43 +02:00
helm
avy
corfu
2023-10-25 19:28:25 +02:00
ivy
2023-10-25 15:34:43 +02:00
vterm
centaur-tabs
treemacs
2023-10-25 19:28:25 +02:00
treemacs-evil
treemacs-nerd-icons
tree-edit
doom-modeline
nerd-icons
nerd-icons-completion
load-relative
2023-10-25 15:34:43 +02:00
lsp-mode
d-mode
org
markdown-mode
json-mode
2023-10-25 19:28:25 +02:00
2023-11-05 11:59:54 +01:00
moe-theme
2023-10-25 15:34:43 +02:00
];
extraConfig = ''
;;;; Set emacs PATH
(setenv "PATH" (concat (getenv "PATH") ":${lib.makeBinPath emacsPkgs}"))
${builtins.concatStringsSep "\n" (builtins.map (x: "(setq exec-path (append exec-path '(\""+x+"/bin\")))" ) emacsPkgs)}
;;;; Done setting PATH
2023-10-25 19:28:25 +02:00
2023-11-04 10:50:50 +01:00
;;;; Config
${builtins.readFile (configPath + "config.el")}
;;;; Config End
2023-10-25 15:34:43 +02:00
'';
};
2023-10-08 11:42:08 +02:00
};
}