system/nix/progs/nvim.nix

38 lines
686 B
Nix

{ lib, config, pkgs, ... }:
with lib;
let
cfg = config.progs.nvim;
bin = "nvim";
in
{
options.progs.nvim = {
enable = mkOption {
type = types.bool;
default = false;
description = "Add and configure exa, a modern replacement for ls";
};
default = mkOption {
type = types.bool;
default = false;
description = "Set neovim as default editor";
};
};
config = mkIf cfg.enable {
# TODO: install and configure neovim from home-manager
home.sessionVariables = mkIf cfg.default {
EDITOR = bin;
};
programs.zsh.shellAliases = mkIf config.shell.zsh.enable {
vi = bin;
vim = bin;
};
};
}