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

@ -5,7 +5,8 @@
pkgs,
...
}:
with lib; let
with lib;
let
cfg = config.plugins.nvim-colorizer;
colorizer-options = {
@ -56,7 +57,13 @@ with lib; 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 {
@ -64,7 +71,11 @@ with lib; let
type = types.nullOr (
types.oneOf [
types.bool
(types.enum ["normal" "lsp" "both"])
(types.enum [
"normal"
"lsp"
"both"
])
]
);
default = null;
@ -87,7 +98,8 @@ with lib; let
default = null;
};
};
in {
in
{
options = {
plugins.nvim-colorizer = {
enable = mkEnableOption "nvim-colorizer";
@ -97,27 +109,23 @@ in {
fileTypes = mkOption {
description = "Enable and/or configure highlighting for certain filetypes";
type = types.nullOr (
types.listOf (types.oneOf [
types.str
(types.submodule {
options =
{
language = mkOption {
type = types.str;
};
}
// colorizer-options;
})
])
types.listOf (
types.oneOf [
types.str
(types.submodule {
options = {
language = mkOption { type = types.str; };
} // colorizer-options;
})
]
)
);
default = null;
};
userDefaultOptions = mkOption {
description = "Default options";
type = types.nullOr (types.submodule {
options = colorizer-options;
});
type = types.nullOr (types.submodule { options = colorizer-options; });
default = null;
};
@ -130,32 +138,33 @@ in {
};
config = mkIf cfg.enable {
extraPlugins = [cfg.package];
extraPlugins = [ cfg.package ];
extraConfigLua = let
filetypes =
if (cfg.fileTypes != null)
then
(
let
list =
map (
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
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},
user_default_options = ${helpers.toLuaObject cfg.userDefaultOptions},
buftypes = ${helpers.toLuaObject cfg.bufTypes},
})
'';
)
else
"nil";
in
''
require("colorizer").setup({
filetypes = ${filetypes},
user_default_options = ${helpers.toLuaObject cfg.userDefaultOptions},
buftypes = ${helpers.toLuaObject cfg.bufTypes},
})
'';
};
}