added formatter + reformat existing codebase (#175)

This commit is contained in:
Gaétan Lepage 2023-02-20 11:42:13 +01:00 committed by GitHub
parent 0bf4313f22
commit 264de8cefb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
96 changed files with 3727 additions and 3341 deletions

View file

@ -1,10 +1,13 @@
{ config, pkgs, lib, ... }:
with lib;
let
cfg = config.plugins.comment-nvim;
helpers = import ../helpers.nix { inherit lib; };
in
{
config,
pkgs,
lib,
...
}:
with lib; let
cfg = config.plugins.comment-nvim;
helpers = import ../helpers.nix {inherit lib;};
in {
options = {
plugins.comment-nvim = {
enable = mkEnableOption "Enable comment-nvim";
@ -27,7 +30,7 @@ in
default = null;
};
toggler = mkOption {
type = types.nullOr (types.submodule ({ ... }: {
type = types.nullOr (types.submodule ({...}: {
options = {
line = mkOption {
type = types.str;
@ -45,7 +48,7 @@ in
default = null;
};
opleader = mkOption {
type = types.nullOr (types.submodule ({ ... }: {
type = types.nullOr (types.submodule ({...}: {
options = {
line = mkOption {
type = types.str;
@ -63,7 +66,7 @@ in
default = null;
};
mappings = mkOption {
type = types.nullOr (types.submodule ({ ... }: {
type = types.nullOr (types.submodule ({...}: {
options = {
basic = mkOption {
type = types.bool;
@ -88,20 +91,18 @@ in
};
};
config =
let
setupOptions = {
padding = cfg.padding;
sticky = cfg.sticky;
ignore = cfg.ignore;
toggler = cfg.toggler;
opleader = cfg.opleader;
mappings = cfg.mappings;
};
in
config = let
setupOptions = {
padding = cfg.padding;
sticky = cfg.sticky;
ignore = cfg.ignore;
toggler = cfg.toggler;
opleader = cfg.opleader;
mappings = cfg.mappings;
};
in
mkIf cfg.enable {
extraPlugins = [ cfg.package ];
extraConfigLua =
''require("Comment").setup${helpers.toLuaObject setupOptions}'';
extraPlugins = [cfg.package];
extraConfigLua = ''require("Comment").setup${helpers.toLuaObject setupOptions}'';
};
}

View file

@ -1,10 +1,13 @@
{ pkgs, config, lib, ... }:
with lib;
let
cfg = config.plugins.commentary;
helpers = import ../helpers.nix { inherit lib; };
in
{
pkgs,
config,
lib,
...
}:
with lib; let
cfg = config.plugins.commentary;
helpers = import ../helpers.nix {inherit lib;};
in {
# TODO Add support for aditional filetypes. This requires autocommands!
options = {
@ -16,6 +19,6 @@ in
};
config = mkIf cfg.enable {
extraPlugins = [ cfg.package ];
extraPlugins = [cfg.package];
};
}

View file

@ -1,11 +1,14 @@
{ config, lib, pkgs, ... }:
with lib;
let
{
config,
lib,
pkgs,
...
}:
with lib; let
cfg = config.plugins.dashboard;
helpers = import ../helpers.nix { inherit lib; };
in
{
helpers = import ../helpers.nix {inherit lib;};
in {
options = {
plugins.dashboard = {
enable = mkEnableOption "dashboard";
@ -90,7 +93,7 @@ in
};
};
};
default = { };
default = {};
};
hideStatusline = mkOption {
@ -107,34 +110,32 @@ in
};
};
config =
let
options = {
custom_header = cfg.header;
custom_footer = cfg.footer;
custom_center = cfg.center;
config = let
options = {
custom_header = cfg.header;
custom_footer = cfg.footer;
custom_center = cfg.center;
preview_file_path = cfg.preview.file;
preview_file_height = cfg.preview.height;
preview_file_width = cfg.preview.width;
preview_command = cfg.preview.command;
preview_file_path = cfg.preview.file;
preview_file_height = cfg.preview.height;
preview_file_width = cfg.preview.width;
preview_command = cfg.preview.command;
hide_statusline = cfg.hideStatusline;
hide_tabline = cfg.hideTabline;
hide_statusline = cfg.hideStatusline;
hide_tabline = cfg.hideTabline;
session_directory = cfg.sessionDirectory;
};
session_directory = cfg.sessionDirectory;
};
filteredOptions = filterAttrs (_: v: !isNull v) options;
in
filteredOptions = filterAttrs (_: v: !isNull v) options;
in
mkIf cfg.enable {
extraPlugins = [ cfg.package ];
extraPlugins = [cfg.package];
extraConfigLua = ''
local dashboard = require("dashboard")
${toString (mapAttrsToList (n: v:
"dashboard.${n} = ${helpers.toLuaObject v}\n")
filteredOptions)}
${toString (mapAttrsToList (n: v: "dashboard.${n} = ${helpers.toLuaObject v}\n")
filteredOptions)}
'';
};
}

View file

@ -1,10 +1,13 @@
{ config, pkgs, lib, ... }:
with lib;
let
cfg = config.plugins.easyescape;
helpers = import ../helpers.nix { inherit lib; };
in
{
config,
pkgs,
lib,
...
}:
with lib; let
cfg = config.plugins.easyescape;
helpers = import ../helpers.nix {inherit lib;};
in {
options = {
plugins.easyescape = {
enable = mkEnableOption "Enable easyescape";

View file

@ -1,34 +1,39 @@
{ lib, pkgs, ... }@attrs:
with lib;
let
helpers = import ../helpers.nix { inherit lib; };
{
lib,
pkgs,
...
} @ attrs:
with lib; let
helpers = import ../helpers.nix {inherit lib;};
eitherAttrsStrInt = with types; let
strInt = either str int;
in either strInt (attrsOf (either strInt (attrsOf strInt)));
in with helpers;
mkPlugin attrs {
name = "emmet";
description = "Enable emmet";
package = pkgs.vimPlugins.emmet-vim;
in
either strInt (attrsOf (either strInt (attrsOf strInt)));
in
with helpers;
mkPlugin attrs {
name = "emmet";
description = "Enable emmet";
package = pkgs.vimPlugins.emmet-vim;
options = {
mode = mkDefaultOpt {
type = types.enum [ "i" "n" "v" "a" ];
global = "user_emmet_mode";
description = "Mode where emmet will enable";
};
options = {
mode = mkDefaultOpt {
type = types.enum ["i" "n" "v" "a"];
global = "user_emmet_mode";
description = "Mode where emmet will enable";
};
leader = mkDefaultOpt {
type = types.str;
global = "user_emmet_leader_key";
description = "Set leader key";
};
leader = mkDefaultOpt {
type = types.str;
global = "user_emmet_leader_key";
description = "Set leader key";
};
settings = mkDefaultOpt {
type = types.attrsOf (types.attrsOf eitherAttrsStrInt);
global = "user_emmet_settings";
description = "Emmet settings";
};
};
}
settings = mkDefaultOpt {
type = types.attrsOf (types.attrsOf eitherAttrsStrInt);
global = "user_emmet_settings";
description = "Emmet settings";
};
};
}

View file

@ -1,12 +1,17 @@
{ lib, pkgs, ... }@attrs:
let
helpers = import ../helpers.nix { inherit lib; };
in with helpers; with lib;
mkPlugin attrs {
name = "endwise";
description = "Enable vim-endwise";
package = pkgs.vimPlugins.vim-endwise;
{
lib,
pkgs,
...
} @ attrs: let
helpers = import ../helpers.nix {inherit lib;};
in
with helpers;
with lib;
mkPlugin attrs {
name = "endwise";
description = "Enable vim-endwise";
package = pkgs.vimPlugins.vim-endwise;
# Yes it's really not configurable
options = {};
}
# Yes it's really not configurable
options = {};
}

View file

@ -1,10 +1,13 @@
{ config, pkgs, lib, ... }:
with lib;
let
cfg = config.plugins.floaterm;
helpers = import ../helpers.nix { inherit lib; };
in
{
config,
pkgs,
lib,
...
}:
with lib; let
cfg = config.plugins.floaterm;
helpers = import ../helpers.nix {inherit lib;};
in {
options = {
plugins.floaterm = {
enable = mkEnableOption "floaterm";
@ -21,7 +24,7 @@ in
default = null;
};
winType = mkOption {
type = types.nullOr (types.enum [ "float" "split" "vsplit" ]);
type = types.nullOr (types.enum ["float" "split" "vsplit"]);
default = null;
};
winWidth = mkOption {
@ -45,17 +48,17 @@ in
default = null;
};
opener = mkOption {
type = types.nullOr (types.enum [ "edit" "split" "vsplit" "tabe" "drop" ]);
type = types.nullOr (types.enum ["edit" "split" "vsplit" "tabe" "drop"]);
description = "Command used for opening a file in the outside nvim from within :terminal";
default = null;
};
autoClose = mkOption {
type = types.nullOr (types.enum [ 0 1 2 ]);
type = types.nullOr (types.enum [0 1 2]);
description = "Whether to close floaterm window once the job gets finished.";
default = null;
};
autoHide = mkOption {
type = types.nullOr (types.enum [ 0 1 2 ]);
type = types.nullOr (types.enum [0 1 2]);
description = "Whether to hide previous floaterm before switching to or opening another one.";
default = null;
};

View file

@ -1,29 +1,34 @@
{ lib, pkgs, ... }@attrs:
let
helpers = import ../helpers.nix { inherit lib; };
in with helpers; with lib;
mkPlugin attrs {
name = "goyo";
description = "Enable goyo.vim";
package = pkgs.vimPlugins.goyo-vim;
{
lib,
pkgs,
...
} @ attrs: let
helpers = import ../helpers.nix {inherit lib;};
in
with helpers;
with lib;
mkPlugin attrs {
name = "goyo";
description = "Enable goyo.vim";
package = pkgs.vimPlugins.goyo-vim;
options = {
width = mkDefaultOpt {
description = "Width";
global = "goyo_width";
type = types.int;
};
options = {
width = mkDefaultOpt {
description = "Width";
global = "goyo_width";
type = types.int;
};
height = mkDefaultOpt {
description = "Height";
global = "goyo_height";
type = types.int;
};
height = mkDefaultOpt {
description = "Height";
global = "goyo_height";
type = types.int;
};
showLineNumbers = mkDefaultOpt {
description = "Show line numbers when in Goyo mode";
global = "goyo_linenr";
type = types.bool;
};
};
}
showLineNumbers = mkDefaultOpt {
description = "Show line numbers when in Goyo mode";
global = "goyo_linenr";
type = types.bool;
};
};
}

View file

@ -1,8 +1,12 @@
{ pkgs, config, lib, ... }:
with lib;
let
{
pkgs,
config,
lib,
...
}:
with lib; let
cfg = config.plugins.harpoon;
helpers = import ../helpers.nix { inherit lib; };
helpers = import ../helpers.nix {inherit lib;};
projectConfigModule = types.submodule {
options = {
@ -15,8 +19,7 @@ let
'';
};
};
in
{
in {
options.plugins.harpoon = {
enable = mkEnableOption "harpoon";
@ -47,7 +50,7 @@ in
'';
projects = mkOption {
default = { };
default = {};
description = ''
Predefined projetcs. The keys of this attrs should be the path to the project.
$HOME is working.
@ -73,50 +76,48 @@ in
Menu window height
'';
borderChars = helpers.defaultNullOpts.mkNullable (types.listOf types.str)
borderChars =
helpers.defaultNullOpts.mkNullable (types.listOf types.str)
"[ \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" ]"
"Border characters"
;
"Border characters";
};
};
config =
let
projects = builtins.mapAttrs
(
name: value: {
term.cmds = value.termCommands;
mark.marks = map (mark: { filename = mark; }) value.marks;
}
)
cfg.projects;
config = let
projects =
builtins.mapAttrs
(
name: value: {
term.cmds = value.termCommands;
mark.marks = map (mark: {filename = mark;}) value.marks;
}
)
cfg.projects;
options = {
global_settings = {
save_on_toggle = cfg.saveOnToggle;
save_on_change = cfg.saveOnChange;
enter_on_sendcmd = cfg.enterOnSendcmd;
tmux_autoclose_windows = cfg.tmuxAutocloseWindows;
excluded_filetypes = cfg.excludedFiletypes;
mark_branch = cfg.markBranch;
};
projects = projects;
menu = {
width = cfg.menu.width;
height = cfg.menu.height;
borderchars = cfg.menu.borderChars;
};
options = {
global_settings = {
save_on_toggle = cfg.saveOnToggle;
save_on_change = cfg.saveOnChange;
enter_on_sendcmd = cfg.enterOnSendcmd;
tmux_autoclose_windows = cfg.tmuxAutocloseWindows;
excluded_filetypes = cfg.excludedFiletypes;
mark_branch = cfg.markBranch;
};
in
projects = projects;
menu = {
width = cfg.menu.width;
height = cfg.menu.height;
borderchars = cfg.menu.borderChars;
};
};
in
mkIf cfg.enable {
extraPlugins = [ cfg.package ];
extraPlugins = [cfg.package];
extraConfigLua = ''
require('harpoon').setup(${helpers.toLuaObject options})
'';
};
}

View file

@ -1,12 +1,12 @@
{ lib
, pkgs
, config
, ...
{
lib,
pkgs,
config,
...
} @ args:
with lib; let
helpers = import ../helpers.nix args;
in
{
in {
options.plugins.indent-blankline = {
enable = mkEnableOption "indent-blankline.nvim";
@ -62,7 +62,7 @@ in
useTreesitter =
helpers.defaultNullOpts.mkBool false
"Use treesitter to calculate indentation when possible.";
"Use treesitter to calculate indentation when possible.";
indentLevel = helpers.defaultNullOpts.mkInt 10 "Specifies the maximum indent level to display.";
@ -107,14 +107,14 @@ in
filetypeExclude =
helpers.defaultNullOpts.mkNullable (types.listOf types.str)
''["lspinfo" "packer" "checkhealth" "help" "man" ""]'' ''
''["lspinfo" "packer" "checkhealth" "help" "man" ""]'' ''
Specifies a list of |filetype| values for which this plugin is not enabled.
Ignored if the value is an empty list.
'';
buftypeExclude =
helpers.defaultNullOpts.mkNullable (types.listOf types.str)
''["terminal" "nofile" "quickfix" "prompt"]'' ''
''["terminal" "nofile" "quickfix" "prompt"]'' ''
Specifies a list of |buftype| values for which this plugin is not enabled.
Ignored if the value is an empty list.
'';
@ -197,7 +197,7 @@ in
contextStartPriority =
helpers.defaultNullOpts.mkInt 10000
"Specifies the |extmarks| priority for the context start.";
"Specifies the |extmarks| priority for the context start.";
contextPatterns = helpers.defaultNullOpts.mkNullable (types.listOf types.str) ''
[
@ -248,12 +248,11 @@ in
helpers.defaultNullOpts.mkBool false "Turns deprecation warning messages off.";
};
config =
let
cfg = config.plugins.indent-blankline;
in
config = let
cfg = config.plugins.indent-blankline;
in
mkIf cfg.enable {
extraPlugins = [ cfg.package ];
extraPlugins = [cfg.package];
globals = {
indent_blankline_char = cfg.char;

View file

@ -1,11 +1,14 @@
{ config, pkgs, lib, ... }:
with lib;
let
cfg = config.plugins.intellitab;
helpers = import ../helpers.nix { inherit lib; };
defs = import ../plugin-defs.nix { inherit pkgs; };
in
{
config,
pkgs,
lib,
...
}:
with lib; let
cfg = config.plugins.intellitab;
helpers = import ../helpers.nix {inherit lib;};
defs = import ../plugin-defs.nix {inherit pkgs;};
in {
options = {
plugins.intellitab = {
enable = mkEnableOption "intellitab.nvim";
@ -15,7 +18,7 @@ in
};
config = mkIf cfg.enable {
extraPlugins = [ cfg.package ];
extraPlugins = [cfg.package];
maps.insert."<Tab>" = "<CMD>lua require([[intellitab]]).indent()<CR>";
plugins.treesitter = {

View file

@ -1,24 +1,27 @@
{ pkgs, lib, config, ... }:
with lib;
let
{
pkgs,
lib,
config,
...
}:
with lib; let
cfg = config.plugins.magma-nvim;
plugins = import ../plugin-defs.nix { inherit pkgs; };
plugins = import ../plugin-defs.nix {inherit pkgs;};
package = pkgs.fetchFromGitHub {
owner = "dccsillag";
repo = "magma-nvim";
rev = version;
sha256 = "sha256-IaslJK1F2BxTvZzKGH9OKOl2RICi4d4rSgjliAIAqK4=";
};
owner = "dccsillag";
repo = "magma-nvim";
rev = version;
sha256 = "sha256-IaslJK1F2BxTvZzKGH9OKOl2RICi4d4rSgjliAIAqK4=";
};
in {
options = {
plugins.magma-nvim = {
enable = mkEnableOption "Enable magma-nvim?";
image_provider = mkOption {
type = types.enum [ "none" "ueberzug" "kitty" ];
type = types.enum ["none" "ueberzug" "kitty"];
default = "none";
example = "ueberzug";
description =
" This configures how to display images. The following options are available:
description = " This configures how to display images. The following options are available:
none -- don't show imagesmagma_image_provider.
ueberzug -- use Ueberzug to display images.
kitty -- use the Kitty protocol to display images.";
@ -27,8 +30,7 @@ in {
type = types.bool;
default = true;
example = false;
description =
" If this is true, then whenever you have an active cell its output window will be automatically shown.
description = " If this is true, then whenever you have an active cell its output window will be automatically shown.
If this is false, then the output window will only be automatically shown when you've just evaluated the code. So, if you take your cursor out of the cell, and then come back, the output window won't be opened (but the cell will be highlighted). This means that there will be nothing covering your code. You can then open the output window at will using :MagmaShowOutput.";
};
@ -36,60 +38,54 @@ in {
type = types.bool;
default = true;
example = false;
description =
" If this is true, then text output in the output window will be wrapped (akin to set wrap).";
description = " If this is true, then text output in the output window will be wrapped (akin to set wrap).";
};
output_window_borders = mkOption {
type = types.bool;
default = true;
example = false;
description =
" If this is true, then the output window will have rounded borders. If it is false, it will have no borders.";
description = " If this is true, then the output window will have rounded borders. If it is false, it will have no borders.";
};
cell_highlight_group = mkOption {
type = types.str;
default = "CursorLine";
# example = "";
description =
" The highlight group to be used for highlighting cells.";
description = " The highlight group to be used for highlighting cells.";
};
save_path = mkOption {
type = types.nullOr types.str;
default = null;
description =
"Where to save/load with :MagmaSave and :MagmaLoad (with no parameters).
description = "Where to save/load with :MagmaSave and :MagmaLoad (with no parameters).
The generated file is placed in this directory, with the filename itself being the buffer's name, with % replaced by %% and / replaced by %, and postfixed with the extension .json.";
};
show_mimetype_debug = mkOption {
type = types.bool;
default = false;
example = true;
description =
" If this is true, then before any non-iostream output chunk, Magma shows the mimetypes it received for it.
description = " If this is true, then before any non-iostream output chunk, Magma shows the mimetypes it received for it.
This is meant for debugging and adding new mimetypes.";
};
package = mkOption {
type = types.nullOr types.package;
default = null;
example =
"package = pkgs.fetchFromGitHub {
example = "package = pkgs.fetchFromGitHub {
owner = \"WhiteBlackGoose\";
repo = \"magma-nvim-goose\";
rev = version;
sha256 = \"sha256-IaslJK1F2BxTvZzKGH9OKOl2RICi4d4rSgjliAIAqK4=\";} ";
};
};
};
config = mkIf cfg.enable {
extraPlugins = [ (
if cfg.package != null then plugins.magma-nvim.override {src = cfg.package;} else plugins.magma-nvim
)];
extraPlugins = [
(
if cfg.package != null
then plugins.magma-nvim.override {src = cfg.package;}
else plugins.magma-nvim
)
];
globals = {
magma_image_provider =
@ -99,13 +95,11 @@ in {
magma_wrap_output = mkIf (!cfg.wrap_output) cfg.wrap_output;
magma_output_window_borders =
mkIf (!cfg.output_window_borders) cfg.output_window_borders;
magma_highlight_group = mkIf (cfg.cell_highlight_group != "CursorLine")
magma_highlight_group =
mkIf (cfg.cell_highlight_group != "CursorLine")
cfg.cell_highlight_group;
magma_show_mimetype_debug =
mkIf cfg.show_mimetype_debug cfg.show_mimetype_debug;
};
};
}

View file

@ -1,12 +1,14 @@
{ pkgs, config, lib, ... }:
with lib;
let
cfg = config.plugins.mark-radar;
helpers = import ../helpers.nix { inherit lib; };
defs = import ../plugin-defs.nix { inherit pkgs; };
in
{
pkgs,
config,
lib,
...
}:
with lib; let
cfg = config.plugins.mark-radar;
helpers = import ../helpers.nix {inherit lib;};
defs = import ../plugin-defs.nix {inherit pkgs;};
in {
options.plugins.mark-radar = {
enable = mkEnableOption "mark-radar";
@ -33,16 +35,15 @@ in
};
};
config =
let
opts = helpers.toLuaObject {
inherit (cfg) highlight_group background_highlight_group;
set_default_mappings = cfg.set_default_keybinds;
background_highlight = cfg.highlight_background;
};
in
config = let
opts = helpers.toLuaObject {
inherit (cfg) highlight_group background_highlight_group;
set_default_mappings = cfg.set_default_keybinds;
background_highlight = cfg.highlight_background;
};
in
mkIf cfg.enable {
extraPlugins = [ cfg.package ];
extraPlugins = [cfg.package];
extraConfigLua = ''
require("mark-radar").setup(${opts})

View file

@ -1,21 +1,24 @@
{ pkgs, config, lib, ... }:
with lib;
let
{
pkgs,
config,
lib,
...
}:
with lib; let
cfg = config.plugins.notify;
helpers = import ../helpers.nix { inherit lib; };
helpers = import ../helpers.nix {inherit lib;};
icon = mkOption {
type = types.nullOr types.str;
default = null;
};
in
{
in {
options.plugins.notify = {
enable = mkEnableOption "notify";
package = helpers.mkPackageOption "notify" pkgs.vimPlugins.nvim-notify;
stages = mkOption {
type = types.nullOr (types.enum [ "fade_in_slide_out" "fade" "slide" "static" ]);
type = types.nullOr (types.enum ["fade_in_slide_out" "fade" "slide" "static"]);
description = "Animation style";
default = null;
};
@ -45,28 +48,27 @@ in
};
});
description = "Icons for the different levels";
default = { };
default = {};
};
};
config =
let
setupOptions = with cfg; {
stages = stages;
timeout = timeout;
background_color = backgroundColor;
minimum_width = minimumWidth;
icons = with icons; {
ERROR = error;
WARN = warn;
INFO = info;
DEBUG = debug;
TRACE = trace;
};
config = let
setupOptions = with cfg; {
stages = stages;
timeout = timeout;
background_color = backgroundColor;
minimum_width = minimumWidth;
icons = with icons; {
ERROR = error;
WARN = warn;
INFO = info;
DEBUG = debug;
TRACE = trace;
};
in
};
in
mkIf cfg.enable {
extraPlugins = [ cfg.package ];
extraPlugins = [cfg.package];
extraConfigLua = ''
vim.notify = require('notify');
require('notify').setup(${helpers.toLuaObject setupOptions})

View file

@ -1,10 +1,13 @@
{ pkgs, config, lib, ... }:
with lib;
let
cfg = config.plugins.nvim-autopairs;
helpers = import ../helpers.nix { inherit lib; };
in
{
pkgs,
config,
lib,
...
}:
with lib; let
cfg = config.plugins.nvim-autopairs;
helpers = import ../helpers.nix {inherit lib;};
in {
options.plugins.nvim-autopairs = {
enable = mkEnableOption "nvim-autopairs";
@ -41,18 +44,17 @@ in
};
};
config =
let
options = {
pairs_map = cfg.pairs;
disable_filetype = cfg.disabledFiletypes;
break_line_filetype = cfg.breakLineFiletypes;
html_break_line_filetype = cfg.htmlFiletypes;
ignored_next_char = cfg.ignoredNextChar;
};
in
config = let
options = {
pairs_map = cfg.pairs;
disable_filetype = cfg.disabledFiletypes;
break_line_filetype = cfg.breakLineFiletypes;
html_break_line_filetype = cfg.htmlFiletypes;
ignored_next_char = cfg.ignoredNextChar;
};
in
mkIf cfg.enable {
extraPlugins = [ cfg.package ];
extraPlugins = [cfg.package];
extraConfigLua = ''
require('nvim-autopairs').setup(${helpers.toLuaObject options})

View file

@ -1,9 +1,12 @@
{ pkgs, config, lib, ... }:
with lib;
let
{
pkgs,
config,
lib,
...
}:
with lib; let
cfg = config.plugins.nvim-colorizer;
helpers = import ../helpers.nix { inherit lib; };
helpers = import ../helpers.nix {inherit lib;};
colorizer-options = {
RGB = mkOption {
@ -53,7 +56,7 @@ let
};
mode = mkOption {
description = "Set the display mode";
type = types.nullOr (types.enum [ "foreground" "background" "virtualtext" ]);
type = types.nullOr (types.enum ["foreground" "background" "virtualtext"]);
default = null;
};
tailwind = mkOption {
@ -61,7 +64,7 @@ let
type = types.nullOr (
types.oneOf [
types.bool
(types.enum [ "normal" "lsp" "both" ])
(types.enum ["normal" "lsp" "both"])
]
);
default = null;
@ -84,12 +87,9 @@ let
default = null;
};
};
in
{
in {
options = {
plugins.nvim-colorizer = {
enable = mkEnableOption "nvim-colorizer";
package = helpers.mkPackageOption "nvim-colorizer" pkgs.vimPlugins.nvim-colorizer-lua;
@ -100,11 +100,13 @@ in
types.listOf (types.oneOf [
types.str
(types.submodule {
options = {
language = mkOption {
type = types.str;
};
} // colorizer-options;
options =
{
language = mkOption {
type = types.str;
};
}
// colorizer-options;
})
])
);
@ -128,24 +130,26 @@ in
};
config = mkIf cfg.enable {
extraPlugins = [ cfg.package ];
extraPlugins = [cfg.package];
extraConfigLua = let
filetypes = if (cfg.fileTypes != null)
then (
let
list = map (
v: if builtins.isAttrs v
then v.language + " = " + helpers.toLuaObject (builtins.removeAttrs v [ "language" ])
else "'${v}'"
) cfg.fileTypes;
in "{" + (concatStringsSep "," list) + "}"
)
else
"nil"
;
filetypes =
if (cfg.fileTypes != null)
then
(
let
list =
map (
v:
if builtins.isAttrs v
then v.language + " = " + helpers.toLuaObject (builtins.removeAttrs v ["language"])
else "'${v}'"
)
cfg.fileTypes;
in
"{" + (concatStringsSep "," list) + "}"
)
else "nil";
in ''
require("colorizer").setup({
filetypes = ${filetypes},

View file

@ -1,27 +1,30 @@
{ pkgs, config, lib, ... }@args:
with lib;
let
cfg = config.plugins.nvim-tree;
helpers = import ../helpers.nix { inherit lib; };
optionWarnings = import ../../lib/option-warnings.nix args;
basePluginPath = [ "plugins" "nvim-tree" ];
in
{
pkgs,
config,
lib,
...
} @ args:
with lib; let
cfg = config.plugins.nvim-tree;
helpers = import ../helpers.nix {inherit lib;};
optionWarnings = import ../../lib/option-warnings.nix args;
basePluginPath = ["plugins" "nvim-tree"];
in {
imports = [
(optionWarnings.mkRenamedOption {
option = basePluginPath ++ [ "updateCwd" ];
newOption = basePluginPath ++ [ "syncRootWithCwd" ];
option = basePluginPath ++ ["updateCwd"];
newOption = basePluginPath ++ ["syncRootWithCwd"];
})
(optionWarnings.mkRenamedOption {
option = basePluginPath ++ [ "updateFocusedFile" "updateCwd" ];
newOption = basePluginPath ++ [ "updateFocusedFile" "updateRoot" ];
option = basePluginPath ++ ["updateFocusedFile" "updateCwd"];
newOption = basePluginPath ++ ["updateFocusedFile" "updateRoot"];
})
(optionWarnings.mkDeprecatedOption {
option = basePluginPath ++ [ "openOnSetup" ];
option = basePluginPath ++ ["openOnSetup"];
alternative = [];
})
(optionWarnings.mkDeprecatedOption {
option = basePluginPath ++ [ "ignoreFtOnSetup" ];
option = basePluginPath ++ ["ignoreFtOnSetup"];
alternative = [];
})
];
@ -102,20 +105,19 @@ in
description = "Enable diagnostics";
};
icons =
let
diagnosticOption = desc: mkOption {
icons = let
diagnosticOption = desc:
mkOption {
type = types.nullOr types.str;
default = null;
description = desc;
};
in
{
hint = diagnosticOption "Hints";
info = diagnosticOption "Info";
warning = diagnosticOption "Warning";
error = diagnosticOption "Error";
};
in {
hint = diagnosticOption "Hints";
info = diagnosticOption "Info";
warning = diagnosticOption "Warning";
error = diagnosticOption "Error";
};
};
updateFocusedFile = {
@ -233,50 +235,49 @@ in
};
};
config =
let
options = {
disable_netrw = cfg.disableNetrw;
hijack_netrw = cfg.hijackNetrw;
open_on_setup = cfg.openOnSetup;
ignore_ft_on_setup = cfg.ignoreFtOnSetup;
open_on_tab = cfg.openOnTab;
hijack_cursor = cfg.hijackCursor;
sync_root_with_cwd = cfg.syncRootWithCwd;
respect_buf_cwd = cfg.respectBufCwd;
update_to_buf_dir = {
enable = cfg.updateToBufDir.enable;
auto_open = cfg.updateToBufDir.autoOpen;
};
diagnostics = cfg.diagnostics;
update_focused_file = {
enable = cfg.updateFocusedFile.enable;
update_root = cfg.updateFocusedFile.updateRoot;
ignore_list = cfg.updateFocusedFile.ignoreList;
};
system_open = cfg.systemOpen;
filters = cfg.filters;
git = cfg.git;
view = {
width = cfg.view.width;
height = cfg.view.height;
hide_root_folder = cfg.view.hideRootFolder;
side = cfg.view.side;
auto_resize = cfg.view.autoResize;
mappings = {
custom_only = cfg.view.mappings.customOnly;
list = cfg.view.mappings.list;
};
number = cfg.view.number;
relativenumber = cfg.view.relativenumber;
signcolumn = cfg.view.signcolumn;
};
trash = {
cmd = cfg.trash.cmd;
require_confirm = cfg.trash.requireConfirm;
};
config = let
options = {
disable_netrw = cfg.disableNetrw;
hijack_netrw = cfg.hijackNetrw;
open_on_setup = cfg.openOnSetup;
ignore_ft_on_setup = cfg.ignoreFtOnSetup;
open_on_tab = cfg.openOnTab;
hijack_cursor = cfg.hijackCursor;
sync_root_with_cwd = cfg.syncRootWithCwd;
respect_buf_cwd = cfg.respectBufCwd;
update_to_buf_dir = {
enable = cfg.updateToBufDir.enable;
auto_open = cfg.updateToBufDir.autoOpen;
};
in
diagnostics = cfg.diagnostics;
update_focused_file = {
enable = cfg.updateFocusedFile.enable;
update_root = cfg.updateFocusedFile.updateRoot;
ignore_list = cfg.updateFocusedFile.ignoreList;
};
system_open = cfg.systemOpen;
filters = cfg.filters;
git = cfg.git;
view = {
width = cfg.view.width;
height = cfg.view.height;
hide_root_folder = cfg.view.hideRootFolder;
side = cfg.view.side;
auto_resize = cfg.view.autoResize;
mappings = {
custom_only = cfg.view.mappings.customOnly;
list = cfg.view.mappings.list;
};
number = cfg.view.number;
relativenumber = cfg.view.relativenumber;
signcolumn = cfg.view.signcolumn;
};
trash = {
cmd = cfg.trash.cmd;
require_confirm = cfg.trash.requireConfirm;
};
};
in
mkIf cfg.enable {
extraPlugins = with pkgs.vimPlugins; [
cfg.package
@ -294,6 +295,6 @@ in
extraConfigLua = ''
require('nvim-tree').setup(${helpers.toLuaObject options})
'';
extraPackages = [ pkgs.git ];
extraPackages = [pkgs.git];
};
}

View file

@ -1,65 +1,69 @@
{ pkgs, config, lib, ... }:
with lib;
let
cfg = config.plugins.project-nvim;
helpers = import ../helpers.nix { inherit lib pkgs; };
in
{
options.plugins.project-nvim = helpers.extraOptionsOptions // {
enable = mkEnableOption "project.nvim";
pkgs,
config,
lib,
...
}:
with lib; let
cfg = config.plugins.project-nvim;
helpers = import ../helpers.nix {inherit lib pkgs;};
in {
options.plugins.project-nvim =
helpers.extraOptionsOptions
// {
enable = mkEnableOption "project.nvim";
package = helpers.mkPackageOption "project-nvim" pkgs.vimPlugins.project-nvim;
package = helpers.mkPackageOption "project-nvim" pkgs.vimPlugins.project-nvim;
manualMode = mkOption {
type = types.nullOr types.bool;
default = null;
manualMode = mkOption {
type = types.nullOr types.bool;
default = null;
};
detectionMethods = mkOption {
type = types.nullOr (types.listOf types.str);
default = null;
};
patterns = mkOption {
type = types.nullOr (types.listOf types.str);
default = null;
};
ignoreLsp = mkOption {
type = types.nullOr (types.listOf types.str);
default = null;
};
excludeDirs = mkOption {
type = types.nullOr (types.listOf types.str);
default = null;
};
showHidden = mkOption {
type = types.nullOr types.bool;
default = null;
};
silentChdir = mkOption {
type = types.nullOr types.bool;
default = null;
};
scopeChdir = mkOption {
type = types.nullOr (types.enum ["global" "tab" "win"]);
default = null;
};
dataPath = mkOption {
type = types.nullOr (types.either types.str helpers.rawType);
default = null;
};
};
detectionMethods = mkOption {
type = types.nullOr (types.listOf types.str);
default = null;
};
patterns = mkOption {
type = types.nullOr (types.listOf types.str);
default = null;
};
ignoreLsp = mkOption {
type = types.nullOr (types.listOf types.str);
default = null;
};
excludeDirs = mkOption {
type = types.nullOr (types.listOf types.str);
default = null;
};
showHidden = mkOption {
type = types.nullOr types.bool;
default = null;
};
silentChdir = mkOption {
type = types.nullOr types.bool;
default = null;
};
scopeChdir = mkOption {
type = types.nullOr (types.enum [ "global" "tab" "win" ]);
default = null;
};
dataPath = mkOption {
type = types.nullOr (types.either types.str helpers.rawType);
default = null;
};
};
config =
let
options = {
config = let
options =
{
manual_mode = cfg.manualMode;
detection_methods = cfg.detectionMethods;
patterns = cfg.patterns;
@ -69,10 +73,11 @@ in
silent_chdir = cfg.silentChdir;
scope_schdir = cfg.scopeChdir;
data_path = cfg.dataPath;
} // cfg.extraOptions;
in
}
// cfg.extraOptions;
in
mkIf cfg.enable {
extraPlugins = [ cfg.package ];
extraPlugins = [cfg.package];
extraConfigLua = ''
require('project_nvim').setup(${helpers.toLuaObject options})

View file

@ -1,10 +1,13 @@
{ pkgs, config, lib, ... }:
with lib;
let
cfg = config.plugins.specs;
helpers = import ../helpers.nix { inherit lib; };
in
{
pkgs,
config,
lib,
...
}:
with lib; let
cfg = config.plugins.specs;
helpers = import ../helpers.nix {inherit lib;};
in {
options.plugins.specs = {
enable = mkEnableOption "specs-nvim";
@ -73,15 +76,16 @@ in
};
};
};
default = { builtin = "linear_fader"; };
default = {builtin = "linear_fader";};
};
resizer = mkOption {
type = types.submodule {
options = {
builtin = mkOption {
type = types.nullOr
(types.enum [ "shrink_resizer" "slide_resizer" "empty_resizer" ]);
type =
types.nullOr
(types.enum ["shrink_resizer" "slide_resizer" "empty_resizer"]);
default = "shrink_resizer";
};
@ -98,48 +102,53 @@ in
};
};
};
default = { builtin = "shrink_resizer"; };
default = {builtin = "shrink_resizer";};
};
ignored_filetypes = mkOption {
type = with types; listOf string;
default = [ ];
default = [];
};
ignored_buffertypes = mkOption {
type = with types; listOf string;
default = [ "nofile" ];
default = ["nofile"];
};
};
config =
let
setup = helpers.toLuaObject {
inherit (cfg) show_jumps min_jump;
ignore_filetypes = attrsets.listToAttrs
(lib.lists.map (x: attrsets.nameValuePair x true)
cfg.ignored_filetypes);
ignore_buftypes = attrsets.listToAttrs
(lib.lists.map (x: attrsets.nameValuePair x true)
cfg.ignored_buffertypes);
popup = {
inherit (cfg) blend width;
winhl = if (!isNull cfg.color) then "SpecsPopColor" else "PMenu";
delay_ms = cfg.delay;
inc_ms = cfg.increment;
fader = helpers.mkRaw (if cfg.fader.builtin == null then
cfg.fader.custom
else
''require("specs").${cfg.fader.builtin}'');
resizer = helpers.mkRaw (if cfg.resizer.builtin == null then
cfg.resizer.custom
else
''require("specs").${cfg.resizer.builtin}'');
};
config = let
setup = helpers.toLuaObject {
inherit (cfg) show_jumps min_jump;
ignore_filetypes =
attrsets.listToAttrs
(lib.lists.map (x: attrsets.nameValuePair x true)
cfg.ignored_filetypes);
ignore_buftypes =
attrsets.listToAttrs
(lib.lists.map (x: attrsets.nameValuePair x true)
cfg.ignored_buffertypes);
popup = {
inherit (cfg) blend width;
winhl =
if (!isNull cfg.color)
then "SpecsPopColor"
else "PMenu";
delay_ms = cfg.delay;
inc_ms = cfg.increment;
fader = helpers.mkRaw (
if cfg.fader.builtin == null
then cfg.fader.custom
else ''require("specs").${cfg.fader.builtin}''
);
resizer = helpers.mkRaw (
if cfg.resizer.builtin == null
then cfg.resizer.custom
else ''require("specs").${cfg.resizer.builtin}''
);
};
in
};
in
mkIf cfg.enable {
extraPlugins = [ cfg.package ];
extraPlugins = [cfg.package];
highlight.SpecsPopColor.bg = mkIf (!isNull cfg.color) cfg.color;

View file

@ -1,220 +1,233 @@
{ pkgs, lib, ... }@args:
let
helpers = import ../helpers.nix { inherit lib; };
in with lib; with helpers;
mkPlugin args {
name = "startify";
description = "Enable startify";
package = pkgs.vimPlugins.vim-startify;
{
pkgs,
lib,
...
} @ args: let
helpers = import ../helpers.nix {inherit lib;};
in
with lib;
with helpers;
mkPlugin args {
name = "startify";
description = "Enable startify";
package = pkgs.vimPlugins.vim-startify;
options = {
sessionDir = mkDefaultOpt {
description = "Directory to save/load session";
global = "startify_session_dir";
type = types.str;
};
lists = mkDefaultOpt {
description = "Startify display lists. If it's a string, it'll be interpreted as literal lua code";
global = "startify_lists";
type = types.listOf (types.oneOf [(types.submodule {
options = {
type = mkOption {
type = types.str;
description = "The type of the list";
};
# TODO the header should be a literal lua string!
header = mkOption {
type = types.nullOr (types.listOf types.str);
description = "Optional header. It's a list of strings";
default = null;
};
indices = mkOption {
type = types.nullOr (types.listOf types.str);
description = "Optional indices for the current list";
default = null;
};
options = {
sessionDir = mkDefaultOpt {
description = "Directory to save/load session";
global = "startify_session_dir";
type = types.str;
};
}) types.str]);
value = val: let
list = map (v: if builtins.isAttrs v then toLuaObject v else v) val;
in "{" + (concatStringsSep "," list) + "}";
};
lists = mkDefaultOpt {
description = "Startify display lists. If it's a string, it'll be interpreted as literal lua code";
global = "startify_lists";
type = types.listOf (types.oneOf [
(types.submodule {
options = {
type = mkOption {
type = types.str;
description = "The type of the list";
};
# TODO the header should be a literal lua string!
header = mkOption {
type = types.nullOr (types.listOf types.str);
description = "Optional header. It's a list of strings";
default = null;
};
indices = mkOption {
type = types.nullOr (types.listOf types.str);
description = "Optional indices for the current list";
default = null;
};
};
})
types.str
]);
bookmarks = mkDefaultOpt {
description = "A list of files or directories to bookmark.";
global = "startify_bookmarks";
type = with types; listOf (oneOf [str (attrsOf str)]);
};
value = val: let
list = map (v:
if builtins.isAttrs v
then toLuaObject v
else v)
val;
in
"{" + (concatStringsSep "," list) + "}";
};
commands = mkDefaultOpt {
description = "A list of commands to execute on selection";
global = "startify_commands";
type = with types; listOf (oneOf [ str (listOf str) attrs ]);
};
bookmarks = mkDefaultOpt {
description = "A list of files or directories to bookmark.";
global = "startify_bookmarks";
type = with types; listOf (oneOf [str (attrsOf str)]);
};
filesNumber = mkDefaultOpt {
description = "The number of files to list";
global = "startify_files_number";
type = types.int;
};
commands = mkDefaultOpt {
description = "A list of commands to execute on selection";
global = "startify_commands";
type = with types; listOf (oneOf [str (listOf str) attrs]);
};
updateOldFiles = mkDefaultOpt {
description = "Update v:oldfiles on-the-fly, so that :Startify is always up-to-date";
global = "startify_update_oldfiles";
type = types.bool;
};
filesNumber = mkDefaultOpt {
description = "The number of files to list";
global = "startify_files_number";
type = types.int;
};
sessionAutoload = mkDefaultOpt {
description = "Load Session.vim";
global = "startify_session_autoload";
type = types.bool;
};
updateOldFiles = mkDefaultOpt {
description = "Update v:oldfiles on-the-fly, so that :Startify is always up-to-date";
global = "startify_update_oldfiles";
type = types.bool;
};
sessionBeforeSave = mkDefaultOpt {
description = "Commands to be executed before saving a session";
global = "startify_session_before_save";
type = types.listOf types.str;
};
sessionAutoload = mkDefaultOpt {
description = "Load Session.vim";
global = "startify_session_autoload";
type = types.bool;
};
sessionPersistence = mkDefaultOpt {
description = "Automatically update sessions";
global = "startify_session_persistence";
type = types.bool;
};
sessionBeforeSave = mkDefaultOpt {
description = "Commands to be executed before saving a session";
global = "startify_session_before_save";
type = types.listOf types.str;
};
sessionDeleteBuffers = mkDefaultOpt {
description = "Delete all buffers when loading or closing a session";
global = "startify_session_delete_buffers";
type = types.bool;
};
sessionPersistence = mkDefaultOpt {
description = "Automatically update sessions";
global = "startify_session_persistence";
type = types.bool;
};
changeToDir = mkDefaultOpt {
description = "When opening a file or bookmark, change to its directory";
global = "startify_change_to_dir";
type = types.bool;
};
sessionDeleteBuffers = mkDefaultOpt {
description = "Delete all buffers when loading or closing a session";
global = "startify_session_delete_buffers";
type = types.bool;
};
changeToVcsRoot = mkDefaultOpt {
description = "When opening a file or bookmark, change to the root directory of the VCS";
global = "startify_change_to_vcs_root";
type = types.bool;
};
changeToDir = mkDefaultOpt {
description = "When opening a file or bookmark, change to its directory";
global = "startify_change_to_dir";
type = types.bool;
};
changeCmd = mkDefaultOpt {
description = "The default command for switching directories";
global = "startify_change_cmd";
type = types.enum [ "cd" "lcd" "tcd" ];
};
changeToVcsRoot = mkDefaultOpt {
description = "When opening a file or bookmark, change to the root directory of the VCS";
global = "startify_change_to_vcs_root";
type = types.bool;
};
skipList = mkDefaultOpt {
description = "A list of regexes that is used to filter recently used files";
global = "startify_skiplist";
type = types.listOf types.str;
};
changeCmd = mkDefaultOpt {
description = "The default command for switching directories";
global = "startify_change_cmd";
type = types.enum ["cd" "lcd" "tcd"];
};
useUnicode = mkDefaultOpt {
description = "Use unicode box drawing characters for the fortune header";
global = "startify_fortune_use_unicode";
type = types.bool;
};
skipList = mkDefaultOpt {
description = "A list of regexes that is used to filter recently used files";
global = "startify_skiplist";
type = types.listOf types.str;
};
paddingLeft = mkDefaultOpt {
description = "Number of spaces used for left padding";
global = "startify_padding_left";
type = types.int;
};
useUnicode = mkDefaultOpt {
description = "Use unicode box drawing characters for the fortune header";
global = "startify_fortune_use_unicode";
type = types.bool;
};
skipListServer = mkDefaultOpt {
description = "Do not create the startify buffer if this is a Vim server instance with a name contained in this list";
global = "startify_skiplist_server";
type = types.listOf types.str;
};
paddingLeft = mkDefaultOpt {
description = "Number of spaces used for left padding";
global = "startify_padding_left";
type = types.int;
};
enableSpecial = mkDefaultOpt {
description = "Show &lt;empty buffer&gt; and &lt;quit&gt;";
global = "startify_enable_special";
type = types.bool;
};
skipListServer = mkDefaultOpt {
description = "Do not create the startify buffer if this is a Vim server instance with a name contained in this list";
global = "startify_skiplist_server";
type = types.listOf types.str;
};
enableUnsafe = mkDefaultOpt {
description = "Improves start time but reduces accuracy of the file list";
global = "startify_enable_unsafe";
type = types.bool;
};
enableSpecial = mkDefaultOpt {
description = "Show &lt;empty buffer&gt; and &lt;quit&gt;";
global = "startify_enable_special";
type = types.bool;
};
sessionRemoveLines = mkDefaultOpt {
description = "Lines matching any of the patterns in this list will be removed from the session file";
global = "startify_session_remove_lines";
type = types.listOf types.str;
};
enableUnsafe = mkDefaultOpt {
description = "Improves start time but reduces accuracy of the file list";
global = "startify_enable_unsafe";
type = types.bool;
};
sessionSaveVars = mkDefaultOpt {
description = "List of variables for Startify to save into the session file";
global = "startify_session_savevars";
type = types.listOf types.str;
};
sessionRemoveLines = mkDefaultOpt {
description = "Lines matching any of the patterns in this list will be removed from the session file";
global = "startify_session_remove_lines";
type = types.listOf types.str;
};
sessionSaveCmds = mkDefaultOpt {
description = "List of cmdline commands to run when loading the session";
global = "startify_session_savecmds";
type = types.listOf types.str;
};
sessionSaveVars = mkDefaultOpt {
description = "List of variables for Startify to save into the session file";
global = "startify_session_savevars";
type = types.listOf types.str;
};
sessionNumber = mkDefaultOpt {
description = "Maximum number of sessions to display";
global = "startify_session_number";
type = types.listOf types.str;
};
sessionSaveCmds = mkDefaultOpt {
description = "List of cmdline commands to run when loading the session";
global = "startify_session_savecmds";
type = types.listOf types.str;
};
sessionSort = mkDefaultOpt {
description = "Sort sessions by modification time rather than alphabetically";
global = "startify_session_sort";
type = types.bool;
};
sessionNumber = mkDefaultOpt {
description = "Maximum number of sessions to display";
global = "startify_session_number";
type = types.listOf types.str;
};
customIndices = mkDefaultOpt {
description = "Use this list as indices instead of increasing numbers";
global = "startify_custom_indices";
type = types.listOf types.str;
};
sessionSort = mkDefaultOpt {
description = "Sort sessions by modification time rather than alphabetically";
global = "startify_session_sort";
type = types.bool;
};
customHeader = mkDefaultOpt {
description = "Define your own header";
global = "startify_custom_header";
type = types.oneOf [ types.str (types.listOf types.str) ];
};
customIndices = mkDefaultOpt {
description = "Use this list as indices instead of increasing numbers";
global = "startify_custom_indices";
type = types.listOf types.str;
};
customQuotes = mkDefaultOpt {
description = "Own quotes for the cowsay header";
global = "startify_custom_header_quotes";
# TODO this should also support funcrefs!
type = types.listOf (types.listOf types.str);
};
customHeader = mkDefaultOpt {
description = "Define your own header";
global = "startify_custom_header";
type = types.oneOf [types.str (types.listOf types.str)];
};
customFooter = mkDefaultOpt {
description = "Custom footer";
global = "startify_custom_footer";
type = types.str;
};
customQuotes = mkDefaultOpt {
description = "Own quotes for the cowsay header";
global = "startify_custom_header_quotes";
# TODO this should also support funcrefs!
type = types.listOf (types.listOf types.str);
};
disableAtVimEnter = mkDefaultOpt {
description = "Don't run Startify at Vim startup";
global = "startify_disable_at_vimenter";
type = types.bool;
};
customFooter = mkDefaultOpt {
description = "Custom footer";
global = "startify_custom_footer";
type = types.str;
};
relativePath = mkDefaultOpt {
description = "If the file is in or below the current working directory, use a relative path";
global = "startify_relative_path";
type = types.bool;
};
disableAtVimEnter = mkDefaultOpt {
description = "Don't run Startify at Vim startup";
global = "startify_disable_at_vimenter";
type = types.bool;
};
useEnv = mkDefaultOpt {
description = "Show environment variables in path, if their name is shorter than their value";
global = "startify_use_env";
type = types.bool;
};
};
}
relativePath = mkDefaultOpt {
description = "If the file is in or below the current working directory, use a relative path";
global = "startify_relative_path";
type = types.bool;
};
useEnv = mkDefaultOpt {
description = "Show environment variables in path, if their name is shorter than their value";
global = "startify_use_env";
type = types.bool;
};
};
}

View file

@ -1,11 +1,16 @@
{ lib, pkgs, ... }@attrs:
let
helpers = import ../helpers.nix { inherit lib; };
in with helpers; with lib;
mkPlugin attrs {
name = "surround";
description = "Enable surround.vim";
package = pkgs.vimPlugins.surround;
{
lib,
pkgs,
...
} @ attrs: let
helpers = import ../helpers.nix {inherit lib;};
in
with helpers;
with lib;
mkPlugin attrs {
name = "surround";
description = "Enable surround.vim";
package = pkgs.vimPlugins.surround;
options = {};
}
options = {};
}

View file

@ -1,10 +1,13 @@
{ pkgs, config, lib, ... }:
with lib;
let
cfg = config.plugins.undotree;
helpers = import ../helpers.nix { inherit lib; };
in
{
pkgs,
config,
lib,
...
}:
with lib; let
cfg = config.plugins.undotree;
helpers = import ../helpers.nix {inherit lib;};
in {
options = {
plugins.undotree = {
enable = mkEnableOption "Enable undotree";
@ -110,7 +113,7 @@ in
};
config = mkIf cfg.enable {
extraPlugins = [ cfg.package ];
extraPlugins = [cfg.package];
globals = {
undotree_WindowLayout = mkIf (cfg.windowLayout != null) cfg.windowLayout;