nixos-configs/modules/editor/emacs/emacs.nix

115 lines
2.9 KiB
Nix
Raw Normal View History

2023-03-21 14:42:39 +01:00
{ inputs, config, lib, pkgs, ... }:
with lib;
with lib.my;
let cfg = config.modules.editor.emacs;
in {
options.modules.editor.emacs = { enable = mkBoolOpt false; };
config = mkIf cfg.enable {
home-manager.users.${config.user.name} = {
2023-05-17 23:23:34 +02:00
nixpkgs.overlays = [ inputs.emacs-overlay.overlay ];
2023-03-21 14:42:39 +01:00
home.packages = with pkgs.unstable; [
2023-05-17 23:23:34 +02:00
binutils
2023-03-21 14:42:39 +01:00
ripgrep
fd
findutils.locate
2023-05-18 22:43:08 +02:00
python311
libsecret
gcc
gnumake
cmake
2023-08-06 22:21:45 +02:00
nodejs
2023-03-21 14:42:39 +01:00
2023-05-17 23:23:34 +02:00
terraform
pandoc
# Formatters and linters
nixfmt # nix formatter
shfmt # sh formatter
shellcheck # sh linter
html-tidy # HTML formatter
nodePackages.stylelint # CSS linter
nodePackages.js-beautify # JS/CSS/HTML formatter
# LSPs
2023-08-06 22:21:45 +02:00
coursier
# metals # Scala
2023-05-17 23:23:34 +02:00
rnix-lsp # Nix
phpactor # PHP
2023-04-21 06:23:57 +02:00
2023-04-22 02:48:21 +02:00
# Used by org-roam
sqlite
graphviz
2023-04-26 12:12:31 +02:00
# Used by elfeed-tube
yt-dlp
mpv
2023-05-17 23:23:34 +02:00
# Used by dirvish
imagemagick
ffmpegthumbnailer
mediainfo
poppler_utils
gnutar
unzip
2023-03-21 14:42:39 +01:00
];
services.emacs = {
enable = true;
client.enable = true;
2023-05-17 23:23:34 +02:00
package = with pkgs;
((emacsPackagesFor emacsNativeComp).emacsWithPackages
(epkgs: [ epkgs.vterm ]));
2023-03-21 14:42:39 +01:00
};
2023-05-17 23:23:34 +02:00
# Use either this or nix-doom-emacs
programs.emacs = {
2023-03-21 14:42:39 +01:00
enable = true;
2023-05-17 23:23:34 +02:00
package = with pkgs;
((emacsPackagesFor emacsNativeComp).emacsWithPackages
(epkgs: [ epkgs.vterm ]));
2023-03-21 14:42:39 +01:00
};
2023-05-17 23:23:34 +02:00
xdg.configFile = { "doom" = { source = ./doom.d; }; };
home.sessionPath = [
"${
config.home-manager.users.${config.user.name}.xdg.configHome
}/emacs/bin"
];
home.activation = {
installDoomEmacs = ''
if [ ! -d "${
config.home-manager.users.${config.user.name}.xdg.configHome
}/emacs" ]; then
git clone --depth=1 --single-branch https://github.com/doomemacs/doomemacs "${
config.home-manager.users.${config.user.name}.xdg.configHome
}/emacs"
fi
'';
};
# imports = [ inputs.nix-doom-emacs.hmModule ];
# programs.doom-emacs = {
# enable = true;
# doomPrivateDir = ./doom.d;
# emacsPackagesOverlay = final: prev: {
# ob-ammonite = with final;
# (trivialBuild {
# src = pkgs.fetchFromGitHub {
# owner = "zwild";
# repo = "ob-ammonite";
# rev = "39937dff395e70aff76a4224fa49cf2ec6c57cca";
# sha256 = pkgs.lib.fakeSha256;
# };
# pname = "ob-ammonite";
# packageRequires = [ s dash editorconfig ];
# });
# };
# };
2023-03-21 14:42:39 +01:00
};
2023-05-17 23:23:34 +02:00
fonts.fonts = [ pkgs.emacs-all-the-icons-fonts ];
2023-03-21 14:42:39 +01:00
};
}