2023-10-27 14:01:54 +02:00
|
|
|
{ config, lib, pkgs, materusArg, ... }:
|
2023-10-08 11:42:08 +02:00
|
|
|
let
|
2024-03-11 16:19:31 +01:00
|
|
|
configPath = "${materusArg.cfg.path}" + "/extraFiles/config/emacs/";
|
|
|
|
|
|
|
|
inits = import ./init.nix { path = configPath; inherit pkgs; };
|
|
|
|
packages = epkgs: with epkgs; [
|
|
|
|
load-relative
|
|
|
|
elcord
|
|
|
|
persp-mode
|
|
|
|
dashboard
|
|
|
|
magit
|
|
|
|
helm
|
|
|
|
avy
|
|
|
|
corfu
|
|
|
|
vterm
|
|
|
|
centaur-tabs
|
|
|
|
projectile
|
|
|
|
company
|
|
|
|
clipetty
|
|
|
|
|
|
|
|
treemacs
|
|
|
|
treemacs-nerd-icons
|
|
|
|
treemacs-perspective
|
|
|
|
treemacs-icons-dired
|
|
|
|
treemacs-magit
|
|
|
|
treemacs-projectile
|
|
|
|
tree-edit
|
|
|
|
vertico
|
|
|
|
nerd-icons
|
|
|
|
nerd-icons-completion
|
|
|
|
perspective
|
|
|
|
minions
|
|
|
|
telephone-line
|
|
|
|
rainbow-delimiters
|
|
|
|
use-package
|
|
|
|
|
|
|
|
cmake-mode
|
|
|
|
lsp-mode
|
|
|
|
lsp-java
|
|
|
|
lsp-jedi
|
|
|
|
lsp-haskell
|
|
|
|
lsp-ui
|
|
|
|
lsp-treemacs
|
|
|
|
dap-mode
|
|
|
|
d-mode
|
|
|
|
multiple-cursors
|
|
|
|
org
|
|
|
|
org-rainbow-tags
|
|
|
|
org-roam
|
|
|
|
org-roam-ui
|
|
|
|
org-review
|
|
|
|
markdown-mode
|
|
|
|
json-mode
|
|
|
|
nix-mode
|
|
|
|
|
|
|
|
minimap
|
|
|
|
|
|
|
|
|
|
|
|
moe-theme
|
|
|
|
doom-themes
|
|
|
|
];
|
2023-11-13 00:44:03 +01:00
|
|
|
|
|
|
|
|
|
|
|
default-config = ''
|
2024-03-11 16:19:31 +01:00
|
|
|
(defvar materus/nix-packages t)
|
|
|
|
(defvar materus/init-from-home nil)
|
|
|
|
(unless materus/init-from-home
|
|
|
|
(message "Config loading not from homeDir, need \"materus/init-from-home\" variable in init.el")
|
|
|
|
${setNixInit}
|
|
|
|
${inits.initText}
|
|
|
|
)
|
2023-11-13 00:44:03 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
emacsPkgs = with pkgs;[
|
|
|
|
python3
|
|
|
|
lua
|
|
|
|
multimarkdown
|
|
|
|
git
|
|
|
|
];
|
2023-11-15 00:07:16 +01:00
|
|
|
|
|
|
|
|
|
|
|
cfg = config.materus.profile.editor.emacs;
|
|
|
|
|
|
|
|
|
2023-11-13 00:44:03 +01:00
|
|
|
setNixInit = ''
|
|
|
|
(setenv "PATH" (concat (getenv "PATH") ":${lib.makeBinPath emacsPkgs}"))
|
|
|
|
${builtins.concatStringsSep "\n" (builtins.map (x: "(setq exec-path (append exec-path '(\""+x+"/bin\")))" ) emacsPkgs)}
|
|
|
|
(call-process-shell-command "${pkgs.xorg.xmodmap}/bin/xmodmap -e \"keycode 66 = Hyper_L\" -e \"remove Mod4 = Hyper_L\" -e \"add Mod3 = Hyper_L\" &" nil 0)
|
|
|
|
'';
|
|
|
|
in
|
|
|
|
{
|
|
|
|
options.materus.profile.editor.emacs.enable = materusArg.pkgs.lib.mkBoolOpt false "Enable emacs with materus cfg";
|
|
|
|
|
|
|
|
config = lib.mkIf cfg.enable {
|
2023-11-14 23:25:05 +01:00
|
|
|
home.activation.emacsCompile = lib.hm.dag.entryAfter [ "linkGeneration" ] ''
|
2024-03-31 22:09:15 +02:00
|
|
|
run ${config.programs.emacs.finalPackage}/bin/emacs --batch \
|
2024-03-11 16:19:31 +01:00
|
|
|
--eval '(setq warning-minimum-log-level :error)' \
|
|
|
|
--eval '(byte-compile-file "${config.xdg.configHome}/emacs/early-init.el")' \
|
|
|
|
--eval '(byte-compile-file "${config.xdg.configHome}/emacs/init.el")'
|
2023-11-14 23:25:05 +01:00
|
|
|
'';
|
2023-11-13 00:44:03 +01:00
|
|
|
xdg.configFile."emacs/init.el".text = ''
|
2024-03-11 16:19:31 +01:00
|
|
|
(defvar materus/nix-packages nil)
|
|
|
|
(defvar materus/init-from-home t)
|
|
|
|
(setq-default materus/init-from-home t)
|
2023-11-15 00:07:16 +01:00
|
|
|
|
2024-03-11 16:19:31 +01:00
|
|
|
${setNixInit}
|
|
|
|
${inits.initText}
|
2023-11-13 00:44:03 +01:00
|
|
|
'';
|
2023-11-15 00:07:16 +01:00
|
|
|
|
|
|
|
xdg.configFile."emacs/early-init.el".text = ''
|
2024-03-11 16:19:31 +01:00
|
|
|
${inits.earlyInitText}
|
2023-11-15 00:07:16 +01:00
|
|
|
'';
|
|
|
|
|
2023-11-13 00:44:03 +01:00
|
|
|
programs.emacs = {
|
|
|
|
enable = true;
|
2024-10-27 22:00:57 +01:00
|
|
|
package = with pkgs; lib.mkDefault (pkgs.emacs29.override {
|
|
|
|
withSQLite3 = true;
|
|
|
|
withWebP = true;
|
|
|
|
withX = true;
|
|
|
|
withGTK3 = true;
|
|
|
|
withAlsaLib = true;
|
|
|
|
withGconf = true;
|
|
|
|
withImageMagick = true;
|
|
|
|
withXwidgets = true;
|
|
|
|
});
|
2023-11-15 00:07:16 +01:00
|
|
|
extraPackages = epkgs: ((packages epkgs));
|
2024-03-11 16:19:31 +01:00
|
|
|
extraConfig = default-config;
|
2023-10-25 15:34:43 +02:00
|
|
|
};
|
2023-10-08 11:42:08 +02:00
|
|
|
|
|
|
|
};
|
|
|
|
}
|