plugins/alpha: remove helpers and with lib

This commit is contained in:
Austin Horstman 2024-09-18 21:33:35 -05:00
parent 17b79813bf
commit beb42716ff
No known key found for this signature in database

View file

@ -1,13 +1,13 @@
{ {
lib, lib,
helpers,
config, config,
options, options,
pkgs, pkgs,
... ...
}: }:
with lib;
let let
inherit (lib) types mkOption;
cfg = config.plugins.alpha; cfg = config.plugins.alpha;
sectionType = types.submodule { sectionType = types.submodule {
@ -24,8 +24,8 @@ let
description = "Type of section"; description = "Type of section";
}; };
val = helpers.mkNullOrOption ( val = lib.nixvim.mkNullOrOption (
with helpers.nixvimTypes; with types;
nullOr (oneOf [ nullOr (oneOf [
# "button", "text" # "button", "text"
@ -53,7 +53,7 @@ in
{ {
options = { options = {
plugins.alpha = { plugins.alpha = {
enable = mkEnableOption "alpha-nvim"; enable = lib.mkEnableOption "alpha-nvim";
package = lib.mkPackageOption pkgs "alpha-nvim" { package = lib.mkPackageOption pkgs "alpha-nvim" {
default = [ default = [
@ -75,8 +75,8 @@ in
] { nullable = true; }; ] { nullable = true; };
theme = mkOption { theme = mkOption {
type = with helpers.nixvimTypes; nullOr (maybeRaw str); type = with types; nullOr (maybeRaw str);
apply = v: if isString v then helpers.mkRaw "require'alpha.themes.${v}'.config" else v; apply = v: if lib.isString v then lib.nixvim.mkRaw "require'alpha.themes.${v}'.config" else v;
default = null; default = null;
example = "dashboard"; example = "dashboard";
description = "You can directly use a pre-defined theme."; description = "You can directly use a pre-defined theme.";
@ -142,7 +142,7 @@ in
]; ];
}; };
opts = helpers.mkNullOrOption (with types; attrsOf anything) '' opts = lib.nixvim.mkNullOrOption (with types; attrsOf anything) ''
Optional global options. Optional global options.
''; '';
}; };
@ -155,12 +155,12 @@ in
opt = options.plugins.alpha; opt = options.plugins.alpha;
in in
mkIf cfg.enable { lib.mkIf cfg.enable {
# TODO: deprecated 2024-08-29 remove after 24.11 # TODO: deprecated 2024-08-29 remove after 24.11
warnings = lib.mkIf opt.iconsEnabled.isDefined [ warnings = lib.mkIf opt.iconsEnabled.isDefined [
'' ''
nixvim (plugins.alpha): nixvim (plugins.alpha):
The option definition `plugins.alpha.iconsEnabled' in ${showFiles opt.iconsEnabled.files} has been deprecated; please remove it. The option definition `plugins.alpha.iconsEnabled' in ${lib.showFiles opt.iconsEnabled.files} has been deprecated; please remove it.
You should use `plugins.alpha.iconsPackage' instead. You should use `plugins.alpha.iconsPackage' instead.
'' ''
]; ];
@ -198,7 +198,7 @@ in
}); });
in in
'' ''
require('alpha').setup(${helpers.toLuaObject setupOptions}) require('alpha').setup(${lib.nixvim.toLuaObject setupOptions})
''; '';
}; };
} }