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,9 +5,11 @@
pkgs,
...
}:
with lib; let
with lib;
let
cfg = config.plugins.specs;
in {
in
{
options.plugins.specs = {
enable = mkEnableOption "specs-nvim";
@ -54,12 +56,14 @@ in {
type = types.submodule {
options = {
builtin = mkOption {
type = types.nullOr (types.enum [
"linear_fader"
"exp_fader"
"pulse_fader"
"empty_fader"
]);
type = types.nullOr (
types.enum [
"linear_fader"
"exp_fader"
"pulse_fader"
"empty_fader"
]
);
default = "linear_fader";
};
@ -76,16 +80,22 @@ 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";
};
@ -102,53 +112,50 @@ in {
};
};
};
default = {builtin = "shrink_resizer";};
default = {
builtin = "shrink_resizer";
};
};
ignored_filetypes = mkOption {
type = with types; listOf str;
default = [];
default = [ ];
};
ignored_buffertypes = mkOption {
type = with types; listOf str;
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 (cfg.color != null)
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}''
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
);
resizer = helpers.mkRaw (
if cfg.resizer.builtin == null
then cfg.resizer.custom
else ''require("specs").${cfg.resizer.builtin}''
ignore_buftypes = attrsets.listToAttrs (
lib.lists.map (x: attrsets.nameValuePair x true) cfg.ignored_buffertypes
);
popup = {
inherit (cfg) blend width;
winhl = if (cfg.color != null) 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 (cfg.color != null) cfg.color;