mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-09-06 18:31:35 +00:00
modules: make lib calls explicit where possible
This commit is contained in:
parent
bf1118eb28
commit
024e1a6845
41 changed files with 245 additions and 203 deletions
|
@ -1,11 +1,7 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkEnableOption;
|
||||
{lib, ...}: let
|
||||
inherit (lib.options) mkEnableOption;
|
||||
in {
|
||||
options.vim.dashboard.alpha = {
|
||||
enable = mkEnableOption "dashboard via alpha.nvim";
|
||||
enable = mkEnableOption "fast and fully programmable greeter for neovim [alpha.mvim]";
|
||||
};
|
||||
}
|
||||
|
|
|
@ -3,7 +3,8 @@
|
|||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf nvim;
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.nvim.dag) entryAnywhere;
|
||||
|
||||
cfg = config.vim.dashboard.alpha;
|
||||
in {
|
||||
|
@ -15,7 +16,7 @@ in {
|
|||
|
||||
# the entire credit for this dashboard configuration to https://github.com/Rishabh672003
|
||||
# honestly, excellent work
|
||||
vim.luaConfigRC.alpha = nvim.dag.entryAnywhere ''
|
||||
vim.luaConfigRC.alpha = entryAnywhere ''
|
||||
local alpha = require("alpha")
|
||||
local plenary_path = require("plenary.path")
|
||||
local dashboard = require("alpha.themes.dashboard")
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
_: {
|
||||
{
|
||||
imports = [
|
||||
./alpha.nix
|
||||
./config.nix
|
||||
|
|
|
@ -3,7 +3,8 @@
|
|||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf nvim;
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.nvim.dag) entryAnywhere;
|
||||
|
||||
cfg = config.vim.dashboard.dashboard-nvim;
|
||||
in {
|
||||
|
@ -12,7 +13,7 @@ in {
|
|||
"dashboard-nvim"
|
||||
];
|
||||
|
||||
vim.luaConfigRC.dashboard-nvim = nvim.dag.entryAnywhere ''
|
||||
vim.luaConfigRC.dashboard-nvim = entryAnywhere ''
|
||||
require("dashboard").setup{}
|
||||
'';
|
||||
};
|
||||
|
|
|
@ -1,11 +1,7 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
{lib, ...}: let
|
||||
inherit (lib) mkEnableOption;
|
||||
in {
|
||||
options.vim.dashboard.dashboard-nvim = {
|
||||
enable = mkEnableOption "dashboard via dashboard.nvim";
|
||||
enable = mkEnableOption "Fancy and Blazing Fast start screen plugin of neovim [dashboard.nvim]";
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
_: {
|
||||
{
|
||||
imports = [
|
||||
./dashboard-nvim.nix
|
||||
./config.nix
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{...}: {
|
||||
{
|
||||
imports = [
|
||||
./alpha
|
||||
./dashboard-nvim
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf nvim;
|
||||
inherit (nvim.vim) mkVimBool;
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.nvim.vim) mkVimBool;
|
||||
|
||||
cfg = config.vim.dashboard.startify;
|
||||
in {
|
||||
|
|
|
@ -3,7 +3,8 @@
|
|||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkEnableOption mkOption types;
|
||||
inherit (lib.options) mkEnableOption mkOption;
|
||||
inherit (lib.types) listOf attrs bool enum str oneOf int;
|
||||
in {
|
||||
options.vim.dashboard.startify = {
|
||||
enable = mkEnableOption "dashboard via vim-startify";
|
||||
|
@ -11,38 +12,38 @@ in {
|
|||
bookmarks = mkOption {
|
||||
default = [];
|
||||
description = ''List of book marks to disaply on start page'';
|
||||
type = with types; listOf attrs;
|
||||
type = listOf attrs;
|
||||
example = {"c" = "~/.vimrc";};
|
||||
};
|
||||
|
||||
changeToDir = mkOption {
|
||||
default = true;
|
||||
description = "Should vim change to the directory of the file you open";
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
};
|
||||
|
||||
changeToVCRoot = mkOption {
|
||||
default = false;
|
||||
description = "Should vim change to the version control root when opening a file";
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
};
|
||||
|
||||
changeDirCmd = mkOption {
|
||||
default = "lcd";
|
||||
description = "Command to change the current window with. Can be cd, lcd or tcd";
|
||||
type = types.enum ["cd" "lcd" "tcd"];
|
||||
type = enum ["cd" "lcd" "tcd"];
|
||||
};
|
||||
|
||||
customHeader = mkOption {
|
||||
default = [];
|
||||
description = "Text to place in the header";
|
||||
type = with types; listOf str;
|
||||
type = listOf str;
|
||||
};
|
||||
|
||||
customFooter = mkOption {
|
||||
default = [];
|
||||
description = "Text to place in the footer";
|
||||
type = with types; listOf str;
|
||||
type = listOf str;
|
||||
};
|
||||
|
||||
lists = mkOption {
|
||||
|
@ -69,121 +70,121 @@ in {
|
|||
}
|
||||
];
|
||||
description = "Specify the lists and in what order they are displayed on startify.";
|
||||
type = with types; listOf attrs;
|
||||
type = listOf attrs;
|
||||
};
|
||||
|
||||
skipList = mkOption {
|
||||
default = [];
|
||||
description = "List of regex patterns to exclude from MRU lists";
|
||||
type = with types; listOf str;
|
||||
type = listOf str;
|
||||
};
|
||||
|
||||
updateOldFiles = mkOption {
|
||||
default = false;
|
||||
description = "Set if you want startify to always update and not just when neovim closes";
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
};
|
||||
|
||||
sessionAutoload = mkOption {
|
||||
default = false;
|
||||
description = "Make startify auto load Session.vim files from the current directory";
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
};
|
||||
|
||||
commands = mkOption {
|
||||
default = [];
|
||||
description = "Commands that are presented to the user on startify page";
|
||||
type = with types; listOf (oneOf [str attrs (listOf str)]);
|
||||
type = listOf (oneOf [str attrs (listOf str)]);
|
||||
};
|
||||
|
||||
filesNumber = mkOption {
|
||||
default = 10;
|
||||
description = "How many files to list";
|
||||
type = types.int;
|
||||
type = int;
|
||||
};
|
||||
|
||||
customIndices = mkOption {
|
||||
default = [];
|
||||
description = "Specify a list of default charecters to use instead of numbers";
|
||||
type = with types; listOf str;
|
||||
type = listOf str;
|
||||
};
|
||||
|
||||
disableOnStartup = mkOption {
|
||||
default = false;
|
||||
description = "Prevent startify from opening on startup but can be called with :Startify";
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
};
|
||||
|
||||
unsafe = mkOption {
|
||||
default = false;
|
||||
description = "Turns on unsafe mode for Startify. Stops resolving links, checking files are readable and filtering bookmark list";
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
};
|
||||
|
||||
paddingLeft = mkOption {
|
||||
default = 3;
|
||||
description = "Number of spaces used for left padding.";
|
||||
type = types.int;
|
||||
type = int;
|
||||
};
|
||||
|
||||
useEnv = mkOption {
|
||||
default = false;
|
||||
description = "Show environment variables in path if name is shorter than value";
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
};
|
||||
|
||||
sessionBeforeSave = mkOption {
|
||||
default = [];
|
||||
description = "Commands to run before saving a session";
|
||||
type = with types; listOf str;
|
||||
type = listOf str;
|
||||
};
|
||||
|
||||
sessionPersistence = mkOption {
|
||||
default = false;
|
||||
description = "Persist session before leaving vim or switching session";
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
};
|
||||
|
||||
sessionDeleteBuffers = mkOption {
|
||||
default = true;
|
||||
description = "Delete all buffers when loading or closing a session";
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
};
|
||||
|
||||
sessionDir = mkOption {
|
||||
default = "~/.vim/session";
|
||||
description = "Directory to save and load sessions from";
|
||||
type = types.str;
|
||||
type = str;
|
||||
};
|
||||
|
||||
skipListServer = mkOption {
|
||||
default = [];
|
||||
description = "List of vim servers to not load startify for";
|
||||
type = with types; listOf str;
|
||||
type = listOf str;
|
||||
};
|
||||
|
||||
sessionRemoveLines = mkOption {
|
||||
default = [];
|
||||
description = "Patterns to remove from session files";
|
||||
type = with types; listOf str;
|
||||
type = listOf str;
|
||||
};
|
||||
|
||||
sessionSavevars = mkOption {
|
||||
default = [];
|
||||
description = "List of variables to save into a session file.";
|
||||
type = with types; listOf str;
|
||||
type = listOf str;
|
||||
};
|
||||
|
||||
sessionSavecmds = mkOption {
|
||||
default = [];
|
||||
description = "List of commands to run when loading a session.";
|
||||
type = with types; listOf str;
|
||||
type = listOf str;
|
||||
};
|
||||
|
||||
sessionSort = mkOption {
|
||||
default = false;
|
||||
description = "Set if you want items sorted by date rather than alphabetically";
|
||||
type = types.bool;
|
||||
type = bool;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue