diff --git a/plugins/by-name/alpha/default.nix b/plugins/by-name/alpha/default.nix index b9bb36f1..105d415c 100644 --- a/plugins/by-name/alpha/default.nix +++ b/plugins/by-name/alpha/default.nix @@ -51,6 +51,20 @@ let }; in { + # TODO: added 2024-09-20 remove after 24.11 + imports = [ + (lib.mkRemovedOptionModule + [ + "plugins" + "alpha" + "iconsPackage" + ] + '' + Please use `plugins.web-devicons` or `plugins.mini.modules.icons` with `plugins.mini.mockDevIcons` instead. + '' + ) + ]; + options = { plugins.alpha = { enable = lib.mkEnableOption "alpha-nvim"; @@ -69,11 +83,6 @@ in visible = false; }; - iconsPackage = lib.mkPackageOption pkgs [ - "vimPlugins" - "nvim-web-devicons" - ] { nullable = true; }; - theme = mkOption { type = with types; nullOr (maybeRaw str); apply = v: if lib.isString v then lib.nixvim.mkRaw "require'alpha.themes.${v}'.config" else v; @@ -156,20 +165,41 @@ in opt = options.plugins.alpha; in lib.mkIf cfg.enable { - # TODO: deprecated 2024-08-29 remove after 24.11 - warnings = lib.mkIf opt.iconsEnabled.isDefined [ - '' - nixvim (plugins.alpha): - 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. - '' - ]; - extraPlugins = - [ cfg.package ] - ++ lib.optional ( - cfg.iconsPackage != null && (opt.iconsEnabled.isDefined -> cfg.iconsEnabled) - ) cfg.iconsPackage; + # TODO: added 2024-09-20 remove after 24.11 + warnings = lib.optionals opt.iconsEnabled.isDefined ( + [ + '' + The option definition `plugins.alpha.iconsEnabled' in ${lib.showFiles opt.iconsEnabled.files} has been deprecated; please remove it. + '' + ] + ++ + lib.optional + ( + (opt.iconsEnabled.isDefined -> cfg.iconsEnabled) + && options.plugins.web-devicons.enable.highestPrio == 1490 + ) + '' + Nixvim (plugins.alpha) `web-devicons` automatic installation is deprecated. + Please use `plugins.web-devicons` or `plugins.mini.modules.icons` with `plugins.mini.mockDevIcons` instead. + '' + ); + plugins.web-devicons = + lib.mkIf + ( + opt.iconsEnabled.isDefined + && cfg.iconsEnabled + && !( + config.plugins.mini.enable + && config.plugins.mini.modules ? icons + && config.plugins.mini.mockDevIcons + ) + ) + { + enable = lib.mkOverride 1490 true; + }; + + extraPlugins = [ cfg.package ]; assertions = [ { diff --git a/tests/test-sources/plugins/by-name/alpha/default.nix b/tests/test-sources/plugins/by-name/alpha/default.nix index d47b0dc3..7f88586f 100644 --- a/tests/test-sources/plugins/by-name/alpha/default.nix +++ b/tests/test-sources/plugins/by-name/alpha/default.nix @@ -100,11 +100,11 @@ }; }; - no-packages = { + no-icons = { + plugins.web-devicons.enable = false; plugins.alpha = { enable = true; theme = "dashboard"; - iconsPackage = null; }; }; }