nixos-config/modules/editors.nix

62 lines
1.5 KiB
Nix
Raw Normal View History

# Your text editor war arsenal.
{ config, options, lib, pkgs, ... }:
2021-11-25 13:45:48 +00:00
let cfg = config.modules.editors;
in {
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.";
};
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-computers
2021-11-25 13:45:48 +00:00
# :tools lookup
wordnet
# :lang org +roam2
sqlite
] else
[ ]);
})
(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 ];
})
(lib.mkIf cfg.vscode.enable {
2021-11-25 13:45:48 +00:00
environment.systemPackages = with pkgs; [ vscode editorconfig-core-c ];
})
];
}