system/modules/home-manager/programs/editors/neovim.nix

24 lines
595 B
Nix

{ config, pkgs, lib, ... }:
let cfg = config.local.programs.editors.neovim; in
{
options.local.programs.editors.neovim = with lib; {
enable = mkEnableOption "neovim";
defaultEditor = mkOption {
description = "set neovim as default editor";
type = types.bool;
default = false;
};
ltex.enable = mkEnableOption "ltex language server";
};
config = lib.mkIf cfg.enable (lib.mkMerge [
(lib.mkIf cfg.ltex.enable {
home.packages = [ pkgs.ltex-ls ];
})
(lib.mkIf cfg.defaultEditor {
home.sessionVariables.EDITOR = "nvim";
})
]);
}