nvf/lib/module/default.nix

46 lines
1.1 KiB
Nix
Raw Normal View History

# Home Manager module
2023-03-31 21:57:25 +00:00
packages: {
2023-03-31 15:17:06 +00:00
pkgs,
config,
lib ? pkgs.lib,
2023-03-31 21:57:25 +00:00
self,
2023-03-31 15:17:06 +00:00
...
}:
with lib; let
cfg = config.programs.neovim-flake;
2023-03-31 22:35:35 +00:00
set = packages.${pkgs.system}.maximal {mainConfig = cfg.settings;};
2023-03-31 15:17:06 +00:00
in {
meta.maintainers = [maintainers.notashelf];
2023-03-31 15:17:06 +00:00
options.programs.neovim-flake = {
enable = mkEnableOption "A NeoVim IDE with a focus on configurability and extensibility.";
2023-03-31 15:17:06 +00:00
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.";
};
2023-03-31 15:17:06 +00:00
};
config = mkIf cfg.enable {
home.packages = [set.neovim];
};
2023-03-31 15:05:28 +00:00
}