nvf/lib/hm-module.nix

46 lines
1.1 KiB
Nix
Raw Normal View History

2023-02-06 18:57:35 +00:00
# Home Manager module
{
2023-03-31 02:27:01 +00:00
self,
2023-02-06 18:57:35 +00:00
config,
2023-03-31 02:27:01 +00:00
pkgs ? self.packages.default,
2023-02-06 18:57:35 +00:00
lib ? pkgs.lib,
...
}: let
cfg = config.programs.neovim-flake;
set = pkgs.neovim-maximal {mainConfig = cfg.settings;};
in
with lib; {
meta.maintainers = [maintainers.notashelf];
options.programs.neovim-flake = {
enable = mkEnableOption "A NeoVim IDE with a focus on configurability and extensibility.";
settings = mkOption {
type = types.attrsOf types.anything;
default = {};
example = literalExpression ''
{
vim.viAlias = false;
vim.vimAlias = true;
vim.lsp = {
enable = true;
formatOnSave = true;
lightbulb.enable = true;
lspsaga.enable = false;
nvimCodeActionMenu.enable = true;
trouble.enable = true;
lspSignature.enable = true;
rust.enable = false;
nix = true;
};
}
'';
description = "Attribute set of neoflake preferences.";
};
};
config = mkIf cfg.enable {
home.packages = [set.neovim];
};
}