nixos-config/modules/programs/emacs/default.nix

60 lines
1.6 KiB
Nix

{ config, lib, pkgs, ... }:
let
cfg = config.ptw.programs.emacs;
weyland-yutani = pkgs.fetchFromGitHub {
owner = "jstaursky";
repo = "weyland-yutani-theme";
rev = "e89a63a62e071180c9cdd9067679fadc3f7bf796";
sha256 = "0gxlz9b7fvbjkqxsyb4l75g7jsxyms0i1vpnb6y499hl115akcaz";
};
in {
options.ptw.programs.emacs = {
enable = lib.mkEnableOption "Configure emacs";
};
config = lib.mkIf cfg.enable {
environment.systemPackages = with pkgs; [ emacs28NativeComp ];
services.emacs.package = pkgs.emacs28NativeComp;
home-manager.users."${config.ptw.system.singleUser}" = {
home.file = {
#".emacs".text = builtins.replaceStrings [ "%%DARTLANG_ANALYSIS_SERVER_PATH%%" "" ] (builtins.readFile ./dotemacs);
".emacs".source = ./dotemacs;
".emacs.d/mu4e.el".source = ./mu4e.el;
".emacs.d/themes/weyland-yutani-theme.el".source = "${weyland-yutani}/weyland-yutani-theme.el";
};
programs.emacs = {
enable = true;
extraPackages = epkgs: with epkgs; [
use-package
rainbow-delimiters
hl-todo
nlinum
ivy
evil
evil-collection
highlight-parentheses
smartparens
undo-tree
perspective
pkgs.mu
org
org-present
graphviz-dot-mode
tide
nix-mode
go-mode
json-mode
rust-mode
yaml-mode
lsp-mode lsp-treemacs flycheck company
dart-mode lsp-dart
];
};
};
};
}