system/home/progs/nvim.nix

34 lines
586 B
Nix

{ lib, config, pkgs, ... }:
with lib;
let
cfg = config.progs.nvim;
myneovim = pkgs.myneovim.override {
enableDevIcons = 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";
};
};
}