2021-11-25 11:55:30 +00:00
|
|
|
{ config, options, lib, pkgs, ... }:
|
|
|
|
|
2021-11-25 13:45:48 +00:00
|
|
|
let cfg = config.modules.editors;
|
|
|
|
in {
|
2021-11-25 11:55:30 +00:00
|
|
|
options.modules.editors = {
|
|
|
|
neovim.enable = lib.mkEnableOption "Enable Neovim and its components";
|
|
|
|
emacs = {
|
|
|
|
enable = lib.mkEnableOption "Enable Emacs and all of its components";
|
2021-11-25 13:45:48 +00:00
|
|
|
doom.enable =
|
|
|
|
lib.mkEnableOption "Enable Doom Emacs-related dependencies.";
|
2021-11-25 11:55:30 +00:00
|
|
|
};
|
|
|
|
vscode.enable = lib.mkEnableOption "Enable Visual Studio Code";
|
|
|
|
};
|
|
|
|
|
|
|
|
config = lib.mkMerge [
|
|
|
|
(lib.mkIf cfg.emacs.enable {
|
2021-11-25 13:45:48 +00:00
|
|
|
environment.systemPackages = with pkgs;
|
|
|
|
[ emacs ] ++ (if cfg.emacs.doom.enable then [
|
|
|
|
# The required depdencies.
|
|
|
|
git
|
|
|
|
ripgrep
|
|
|
|
gnutls
|
2021-11-27 08:04:01 +00:00
|
|
|
emacs-all-the-icons-fonts
|
2021-11-25 13:45:48 +00:00
|
|
|
|
|
|
|
# Optional dependencies.
|
|
|
|
fd
|
|
|
|
imagemagick
|
|
|
|
zstd
|
|
|
|
|
|
|
|
# Module dependencies
|
|
|
|
# :checkers spell
|
|
|
|
aspell
|
|
|
|
aspellDicts.en
|
|
|
|
aspellDicts.en-computer
|
|
|
|
|
|
|
|
# :tools lookup
|
|
|
|
wordnet
|
|
|
|
|
|
|
|
# :lang org +roam2
|
|
|
|
sqlite
|
|
|
|
] else
|
|
|
|
[ ]);
|
2021-11-25 11:55:30 +00:00
|
|
|
})
|
|
|
|
|
|
|
|
(lib.mkIf cfg.neovim.enable {
|
|
|
|
programs.neovim = {
|
|
|
|
enable = true;
|
|
|
|
defaultEditor = true;
|
|
|
|
withNodeJs = true;
|
|
|
|
withRuby = true;
|
|
|
|
};
|
|
|
|
|
2021-11-25 13:45:48 +00:00
|
|
|
environment.systemPackages = with pkgs; [ editorconfig-core-c ];
|
2021-11-25 11:55:30 +00:00
|
|
|
})
|
|
|
|
|
|
|
|
(lib.mkIf cfg.vscode.enable {
|
2021-11-25 13:45:48 +00:00
|
|
|
environment.systemPackages = with pkgs; [ vscode editorconfig-core-c ];
|
2021-11-25 11:55:30 +00:00
|
|
|
})
|
|
|
|
];
|
|
|
|
}
|