mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 16:39:00 +02:00
* barbar: package option * Base16: package option * gruvbox: package option * nord: package option * one: package option * onedark: package option * tokyonight: package option * nvim-cmp: package option * coq: package option * lspkind: package option * helpers: added package option to mkPlugin * fugitive: package option * gitgutter: package option * gitsigns: package option * neogit: package option * ledger: package option * nix: package option * plantuml-syntax: package option * treesitter-context: package option + formatting * treesitter-refactor: package option + formatting * treesitter: package option * zig: package option * null-ls: package option * null-ls/servers: package option * lsp-lines: package option * lspsaga: package option * trouble: package option * luasnip: added description for package option * airline: package option * lightline: package option * lualine: package option * telescope: package option * telescope/frecency: package option * telescope/fzf-native: package option * telescope/media-files: package option * comment-nvim: package option * vim-commentary: package option * dashboard: package option * easyescape: package option * emmet: package option * endwise: package option * floaterm: package option * goyo: package option * intellitab: package option * mark-radar: package option * notify: package option * nvim-autopairs: package option * nvim-tree: package option * project-nvim: package option * specs: package option * startify: package option * surround: package option * undotree: package option
236 lines
6.5 KiB
Nix
236 lines
6.5 KiB
Nix
{ config, lib, pkgs, ... }:
|
|
with lib;
|
|
let
|
|
cfg = config.plugins.neogit;
|
|
helpers = import ../helpers.nix { inherit lib; };
|
|
|
|
sectionDefaultsModule = types.submodule {
|
|
options = {
|
|
folded = mkOption {
|
|
type = types.nullOr types.bool;
|
|
default = null;
|
|
};
|
|
};
|
|
};
|
|
in
|
|
{
|
|
options = {
|
|
plugins.neogit = {
|
|
enable = mkEnableOption "Enable neogit";
|
|
|
|
package = mkOption {
|
|
type = types.package;
|
|
default = pkgs.vimPlugins.neogit;
|
|
description = "Plugin to use for neogit";
|
|
};
|
|
|
|
disableSigns = mkOption {
|
|
description = "Disable signs";
|
|
type = types.nullOr types.bool;
|
|
default = null;
|
|
};
|
|
|
|
disableHint = mkOption {
|
|
description = "Disable hint";
|
|
type = types.nullOr types.bool;
|
|
default = null;
|
|
};
|
|
|
|
disableContextHighlighting = mkOption {
|
|
description = "Disable the context highlighting";
|
|
type = types.nullOr types.bool;
|
|
default = null;
|
|
};
|
|
|
|
disableCommitConfirmation = mkOption {
|
|
description = "Disable the commit confirmation prompt";
|
|
type = types.nullOr types.bool;
|
|
default = null;
|
|
};
|
|
|
|
autoRefresh = mkOption {
|
|
description = "Enable Auto Refresh";
|
|
type = types.nullOr types.bool;
|
|
default = null;
|
|
};
|
|
|
|
disableBuiltinNotifications = mkOption {
|
|
description = "Disable builtin notifications";
|
|
type = types.nullOr types.bool;
|
|
default = null;
|
|
};
|
|
|
|
useMagitKeybindings = mkOption {
|
|
description = "Enable Magit keybindings";
|
|
type = types.nullOr types.bool;
|
|
default = null;
|
|
};
|
|
|
|
commitPopup = mkOption {
|
|
description = "Commit popup configuration";
|
|
type = types.submodule {
|
|
options = {
|
|
kind = mkOption {
|
|
type = types.nullOr types.str;
|
|
default = null;
|
|
};
|
|
};
|
|
};
|
|
default = { };
|
|
};
|
|
|
|
kind = mkOption {
|
|
description = "The way of opening neogit";
|
|
type = types.nullOr types.str;
|
|
default = null;
|
|
};
|
|
|
|
signs = mkOption {
|
|
description = "Customize displayed signs";
|
|
type = types.submodule {
|
|
options = {
|
|
section = mkOption {
|
|
description = "Cosed and opened signs for sections";
|
|
type = types.nullOr (types.listOf types.str);
|
|
default = null;
|
|
};
|
|
|
|
item = mkOption {
|
|
description = "Cosed and opened signs for items";
|
|
type = types.nullOr (types.listOf types.str);
|
|
default = null;
|
|
};
|
|
|
|
hunk = mkOption {
|
|
description = "Cosed and opened signs for hunks";
|
|
type = types.nullOr (types.listOf types.str);
|
|
default = null;
|
|
};
|
|
};
|
|
};
|
|
default = { };
|
|
};
|
|
|
|
integrations = mkOption {
|
|
description = "Tools integration";
|
|
type = types.submodule {
|
|
options = {
|
|
diffview = mkOption {
|
|
description = "Enable diff popup";
|
|
type = types.bool;
|
|
default = false;
|
|
};
|
|
};
|
|
};
|
|
default = { };
|
|
};
|
|
|
|
sections = mkOption {
|
|
description = "Section configuration";
|
|
type = types.submodule {
|
|
options = {
|
|
untracked = mkOption {
|
|
description = "Options for untracked section";
|
|
type = types.nullOr sectionDefaultsModule;
|
|
default = null;
|
|
};
|
|
unstaged = mkOption {
|
|
description = "Options for unstaged section";
|
|
type = types.nullOr sectionDefaultsModule;
|
|
default = null;
|
|
};
|
|
staged = mkOption {
|
|
description = "Options for staged section";
|
|
type = types.nullOr sectionDefaultsModule;
|
|
default = null;
|
|
};
|
|
stashes = mkOption {
|
|
description = "Options for stashes section";
|
|
type = types.nullOr sectionDefaultsModule;
|
|
default = null;
|
|
};
|
|
unpulled = mkOption {
|
|
description = "Options for unpulled section";
|
|
type = types.nullOr sectionDefaultsModule;
|
|
default = null;
|
|
};
|
|
unmerged = mkOption {
|
|
description = "Options for unmerged section";
|
|
type = types.nullOr sectionDefaultsModule;
|
|
default = null;
|
|
};
|
|
recent = mkOption {
|
|
description = "Options for recent commits section";
|
|
type = types.nullOr sectionDefaultsModule;
|
|
default = null;
|
|
};
|
|
};
|
|
};
|
|
default = { };
|
|
};
|
|
|
|
mappings = mkOption {
|
|
description = "Custom mappings";
|
|
type = types.submodule {
|
|
options = {
|
|
status = mkOption {
|
|
type = types.nullOr (types.attrsOf (types.enum [
|
|
"Close"
|
|
"Depth1"
|
|
"Depth2"
|
|
"Depth3"
|
|
"Depth4"
|
|
"Toggle"
|
|
"Discard"
|
|
"Stage"
|
|
"StageUnstaged"
|
|
"StageAll"
|
|
"GoToFile"
|
|
"Unstaged"
|
|
"UnstagedStage"
|
|
"CommandHistory"
|
|
"RefreshBuffer"
|
|
"HelpPopup"
|
|
"PullPopup"
|
|
"PushPopup"
|
|
"CommitPopup"
|
|
"LogPopup"
|
|
"StashPopup"
|
|
"BranchPopup"
|
|
]));
|
|
default = null;
|
|
};
|
|
};
|
|
};
|
|
default = { };
|
|
};
|
|
};
|
|
};
|
|
|
|
config =
|
|
let
|
|
setupOptions = with cfg; helpers.toLuaObject {
|
|
inherit kind integrations signs sections mappings;
|
|
disable_signs = disableSigns;
|
|
disable_hint = disableHint;
|
|
disable_context_highlighting = disableContextHighlighting;
|
|
disable_commit_confirmation = disableCommitConfirmation;
|
|
auto_refresh = autoRefresh;
|
|
disable_builtin_notifications = disableBuiltinNotifications;
|
|
use_magit_keybindings = useMagitKeybindings;
|
|
commit_popup = commitPopup;
|
|
};
|
|
in
|
|
mkIf cfg.enable {
|
|
extraPlugins = with pkgs.vimPlugins; [
|
|
cfg.package
|
|
plenary-nvim
|
|
] ++ optional cfg.integrations.diffview diffview-nvim;
|
|
|
|
extraPackages = [ pkgs.git ];
|
|
|
|
extraConfigLua = ''
|
|
require('neogit').setup(${setupOptions})
|
|
'';
|
|
};
|
|
}
|