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
|
|
|
config,
|
2024-04-07 16:16:08 +02:00
|
|
|
pkgs,
|
2023-03-31 17:17:06 +02:00
|
|
|
lib ? pkgs.lib,
|
|
|
|
...
|
2024-04-07 16:16:08 +02:00
|
|
|
}: let
|
|
|
|
inherit (lib) maintainers;
|
|
|
|
inherit (lib.modules) mkIf;
|
|
|
|
inherit (lib.options) mkOption mkEnableOption literalExpression;
|
|
|
|
inherit (lib.types) attrsOf anything;
|
|
|
|
|
2023-03-31 17:17:06 +02:00
|
|
|
cfg = config.programs.neovim-flake;
|
2023-07-11 23:15:23 +02:00
|
|
|
inherit (import ../../configuration.nix inputs) neovimConfiguration;
|
2024-04-07 16:16:08 +02:00
|
|
|
|
|
|
|
builtPackage = neovimConfiguration {
|
2023-04-01 14:19:46 +02:00
|
|
|
inherit pkgs;
|
|
|
|
modules = [cfg.settings];
|
|
|
|
};
|
2023-03-31 17:17:06 +02:00
|
|
|
in {
|
2023-07-11 23:15:23 +02:00
|
|
|
meta.maintainers = with maintainers; [NotAShelf];
|
2023-03-31 16:42:05 +02:00
|
|
|
|
2023-03-31 17:17:06 +02:00
|
|
|
options.programs.neovim-flake = {
|
2024-04-07 16:16:08 +02:00
|
|
|
enable = mkEnableOption "neovim-flake, the extensible neovim-wrapper";
|
2023-03-31 16:42:05 +02:00
|
|
|
|
2023-03-31 17:17:06 +02:00
|
|
|
settings = mkOption {
|
2024-04-07 16:16:08 +02:00
|
|
|
type = attrsOf anything;
|
2023-03-31 17:17:06 +02:00
|
|
|
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 {
|
2024-04-07 16:16:08 +02:00
|
|
|
home.packages = [builtPackage];
|
2023-04-02 19:11:46 +02:00
|
|
|
};
|
2023-03-31 17:05:28 +02:00
|
|
|
}
|