system/home/progs/nvim.nix

37 lines
651 B
Nix

{ lib, config, pkgs, ... }:
with lib;
let
cfg = config.progs.nvim;
myneovim = pkgs.myneovim.override {
viAlias = true;
vimAlias = true;
enableDevIcons = true;
enableTabby = true;
};
in
{
options.progs.nvim = {
enable = mkOption {
type = types.bool;
default = false;
description = "Add and configure neovim";
};
default = mkOption {
type = types.bool;
default = false;
description = "Set neovim as default editor";
};
};
config = mkIf cfg.enable {
home.packages = [ myneovim ];
home.sessionVariables = mkIf cfg.default {
EDITOR = "nvim";
};
};
}