mirror of
https://github.com/nix-community/nixvim.git
synced 2025-07-12 18:24:35 +02:00
treewide: Reformat with nixfmt
This commit is contained in:
parent
c6281260dc
commit
62f32bfc71
459 changed files with 28139 additions and 26377 deletions
|
@ -5,7 +5,8 @@
|
|||
pkgs,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
with lib;
|
||||
let
|
||||
cfg = config.plugins.alpha;
|
||||
|
||||
sectionType = types.submodule {
|
||||
|
@ -22,32 +23,32 @@ with lib; let
|
|||
description = "Type of section";
|
||||
};
|
||||
|
||||
val =
|
||||
helpers.mkNullOrOption
|
||||
(with helpers.nixvimTypes;
|
||||
nullOr (oneOf [
|
||||
# "button", "text"
|
||||
str
|
||||
# "padding"
|
||||
int
|
||||
(listOf (
|
||||
either
|
||||
val = helpers.mkNullOrOption (
|
||||
with helpers.nixvimTypes;
|
||||
nullOr (oneOf [
|
||||
# "button", "text"
|
||||
str
|
||||
# "padding"
|
||||
int
|
||||
(listOf (
|
||||
either
|
||||
# "text" (list of strings)
|
||||
str
|
||||
# "group"
|
||||
(attrsOf anything)
|
||||
))
|
||||
]))
|
||||
"Value for section";
|
||||
))
|
||||
])
|
||||
) "Value for section";
|
||||
|
||||
opts = mkOption {
|
||||
type = with types; attrsOf anything;
|
||||
default = {};
|
||||
default = { };
|
||||
description = "Additional options for the section";
|
||||
};
|
||||
};
|
||||
};
|
||||
in {
|
||||
in
|
||||
{
|
||||
options = {
|
||||
plugins.alpha = {
|
||||
enable = mkEnableOption "alpha-nvim";
|
||||
|
@ -62,10 +63,7 @@ in {
|
|||
|
||||
theme = mkOption {
|
||||
type = with helpers.nixvimTypes; nullOr (maybeRaw str);
|
||||
apply = v:
|
||||
if isString v
|
||||
then helpers.mkRaw "require'alpha.themes.${v}'.config"
|
||||
else v;
|
||||
apply = v: if isString v then helpers.mkRaw "require'alpha.themes.${v}'.config" else v;
|
||||
default = null;
|
||||
example = "dashboard";
|
||||
description = "You can directly use a pre-defined theme.";
|
||||
|
@ -73,7 +71,7 @@ in {
|
|||
|
||||
layout = mkOption {
|
||||
type = types.listOf sectionType;
|
||||
default = [];
|
||||
default = [ ];
|
||||
description = "List of sections to layout for the dashboard";
|
||||
example = [
|
||||
{
|
||||
|
@ -137,16 +135,13 @@ in {
|
|||
};
|
||||
};
|
||||
|
||||
config = let
|
||||
layoutDefined = cfg.layout != [];
|
||||
themeDefined = cfg.theme != null;
|
||||
in
|
||||
config =
|
||||
let
|
||||
layoutDefined = cfg.layout != [ ];
|
||||
themeDefined = cfg.theme != null;
|
||||
in
|
||||
mkIf cfg.enable {
|
||||
extraPlugins =
|
||||
[
|
||||
cfg.package
|
||||
]
|
||||
++ (optional cfg.iconsEnabled pkgs.vimPlugins.nvim-web-devicons);
|
||||
extraPlugins = [ cfg.package ] ++ (optional cfg.iconsEnabled pkgs.vimPlugins.nvim-web-devicons);
|
||||
|
||||
assertions = [
|
||||
{
|
||||
|
@ -164,19 +159,18 @@ in {
|
|||
}
|
||||
];
|
||||
|
||||
extraConfigLua = let
|
||||
setupOptions =
|
||||
if themeDefined
|
||||
then cfg.theme
|
||||
else
|
||||
(with cfg; {
|
||||
inherit
|
||||
layout
|
||||
opts
|
||||
;
|
||||
});
|
||||
in ''
|
||||
require('alpha').setup(${helpers.toLuaObject setupOptions})
|
||||
'';
|
||||
extraConfigLua =
|
||||
let
|
||||
setupOptions =
|
||||
if themeDefined then
|
||||
cfg.theme
|
||||
else
|
||||
(with cfg; {
|
||||
inherit layout opts;
|
||||
});
|
||||
in
|
||||
''
|
||||
require('alpha').setup(${helpers.toLuaObject setupOptions})
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue