2023-03-31 16:42:05 +02:00
|
|
|
# Home Manager module
|
2023-04-01 14:19:46 +02:00
|
|
|
packages: inputs: {
|
2023-03-31 17:17:06 +02:00
|
|
|
pkgs,
|
|
|
|
config,
|
|
|
|
lib ? pkgs.lib,
|
2023-03-31 23:57:25 +02:00
|
|
|
self,
|
2023-03-31 17:17:06 +02:00
|
|
|
...
|
|
|
|
}:
|
|
|
|
with lib; let
|
|
|
|
cfg = config.programs.neovim-flake;
|
2023-04-01 14:19:46 +02:00
|
|
|
inherit (import ../../extra.nix inputs) neovimConfiguration;
|
|
|
|
set = neovimConfiguration {
|
|
|
|
inherit pkgs;
|
|
|
|
modules = [cfg.settings];
|
|
|
|
};
|
2023-03-31 17:17:06 +02:00
|
|
|
in {
|
|
|
|
meta.maintainers = [maintainers.notashelf];
|
2023-03-31 16:42:05 +02:00
|
|
|
|
2023-03-31 17:17:06 +02:00
|
|
|
options.programs.neovim-flake = {
|
|
|
|
enable = mkEnableOption "A NeoVim IDE with a focus on configurability and extensibility.";
|
2023-03-31 16:42:05 +02:00
|
|
|
|
2023-03-31 17:17:06 +02: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 16:42:05 +02:00
|
|
|
};
|
2023-03-31 17:17:06 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
home.packages = [set.neovim];
|
2023-04-02 18:58:13 +02:00
|
|
|
|
|
|
|
assertions = mkMerge [
|
|
|
|
mkIf
|
|
|
|
(config.programs.neovim-flake.enable)
|
|
|
|
{
|
|
|
|
assertion = !config.programs.neovim.enable;
|
|
|
|
message = "You cannot use neovim-flake together with vanilla neovim.";
|
|
|
|
}
|
|
|
|
];
|
2023-04-02 19:01:48 +02:00
|
|
|
|
2023-03-31 17:17:06 +02:00
|
|
|
};
|
2023-03-31 17:05:28 +02:00
|
|
|
}
|