treewide: Reformat with nixfmt

This commit is contained in:
traxys 2024-05-05 19:39:35 +02:00
parent c6281260dc
commit 62f32bfc71
459 changed files with 28139 additions and 26377 deletions

View file

@ -1,9 +1,6 @@
{
lib,
config,
...
}:
with lib; let
{ lib, config, ... }:
with lib;
let
pluginWithConfigType = types.submodule {
options = {
config = mkOption {
@ -12,11 +9,9 @@ with lib; let
default = "";
};
optional =
mkEnableOption "optional"
// {
description = "Don't load by default (load with :packadd)";
};
optional = mkEnableOption "optional" // {
description = "Don't load by default (load with :packadd)";
};
plugin = mkOption {
type = types.package;
@ -24,24 +19,25 @@ with lib; let
};
};
};
in {
in
{
options = {
extraPlugins = mkOption {
type = with types; listOf (either package pluginWithConfigType);
default = [];
default = [ ];
description = "List of vim plugins to install";
};
extraPackages = mkOption {
type = with types; listOf (nullOr package);
default = [];
default = [ ];
description = "Extra packages to be made available to neovim";
apply = builtins.filter (p: p != null);
};
extraPython3Packages = mkOption {
type = with types; functionTo (listOf package);
default = p: [];
default = p: [ ];
defaultText = literalExpression "p: with p; [ ]";
description = "Python packages to add to the `PYTHONPATH` of neovim.";
example = lib.literalExpression ''
@ -74,7 +70,10 @@ in {
};
type = mkOption {
type = types.enum ["vim" "lua"];
type = types.enum [
"vim"
"lua"
];
default = "lua";
description = "Whether the generated file is a vim or a lua file";
};
@ -94,40 +93,39 @@ in {
extraLuaPackages = mkOption {
type = types.functionTo (types.listOf types.package);
description = "Extra lua packages to include with neovim";
default = _: [];
default = _: [ ];
};
extraFiles = mkOption {
type = types.attrsOf types.str;
description = "Extra files to add to the runtime path";
default = {};
default = { };
};
};
config = let
contentLua = ''
${config.extraConfigLuaPre}
vim.cmd([[
${config.extraConfigVim}
]])
${config.extraConfigLua}
${config.extraConfigLuaPost}
'';
contentVim = ''
lua << EOF
config =
let
contentLua = ''
${config.extraConfigLuaPre}
EOF
${config.extraConfigVim}
lua << EOF
vim.cmd([[
${config.extraConfigVim}
]])
${config.extraConfigLua}
${config.extraConfigLuaPost}
EOF
'';
in {
content =
if config.type == "lua"
then contentLua
else contentVim;
};
'';
contentVim = ''
lua << EOF
${config.extraConfigLuaPre}
EOF
${config.extraConfigVim}
lua << EOF
${config.extraConfigLua}
${config.extraConfigLuaPost}
EOF
'';
in
{
content = if config.type == "lua" then contentLua else contentVim;
};
}