From 5ad022e1510bfb6b235a9161ffae8e72b2ebe1a4 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Mon, 7 Apr 2025 23:16:39 +0200 Subject: [PATCH] modules/dependencies: add glow --- modules/dependencies.nix | 1 + plugins/by-name/glow/default.nix | 21 +++++++++++-------- .../plugins/by-name/glow/default.nix | 3 --- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/modules/dependencies.nix b/modules/dependencies.nix index fd61f560..d1d1bc17 100644 --- a/modules/dependencies.nix +++ b/modules/dependencies.nix @@ -25,6 +25,7 @@ let default = "git"; example = [ "gitMinimal" ]; }; + glow.default = "glow"; go.default = "go"; lazygit.default = "lazygit"; lean.default = "lean4"; diff --git a/plugins/by-name/glow/default.nix b/plugins/by-name/glow/default.nix index d1b6acd2..89e19d46 100644 --- a/plugins/by-name/glow/default.nix +++ b/plugins/by-name/glow/default.nix @@ -1,6 +1,5 @@ { lib, - pkgs, ... }: let @@ -13,19 +12,27 @@ lib.nixvim.plugins.mkNeovimPlugin { maintainers = [ lib.maintainers.getchoo ]; + imports = [ + # TODO: added 2025-04-07, remove after 25.05 + (lib.nixvim.mkRemovedPackageOptionModule { + plugin = "glow"; + packageName = "glow"; + }) + ]; + settingsOptions = { glow_path = defaultNullOpts.mkStr (lib.nixvim.mkRaw "vim.fn.exepath('glow')") '' Path to `glow` binary. If null or `""`, `glow` in your `$PATH` with be used if available. - Using `glowPackage` is the recommended way to make `glow` available in your `$PATH`. + Using `dependencies.glow` is the recommended way to make `glow` available in your `$PATH`. ''; install_path = defaultNullOpts.mkStr "~/.local/bin" '' Path for installing `glow` binary if one is not found at `glow_path` or in your `$PATH`. - Consider using `glowPackage` instead. + Consider using `dependencies.glow` instead. ''; border = defaultNullOpts.mkEnumFirstDefault [ @@ -76,11 +83,7 @@ lib.nixvim.plugins.mkNeovimPlugin { height_ratio = 0.7; }; - extraOptions = { - glowPackage = lib.mkPackageOption pkgs "glow" { - nullable = true; - }; + extraConfig = { + dependencies.glow.enable = lib.mkDefault true; }; - - extraConfig = cfg: { extraPackages = [ cfg.glowPackage ]; }; } diff --git a/tests/test-sources/plugins/by-name/glow/default.nix b/tests/test-sources/plugins/by-name/glow/default.nix index e217615d..fb61faf8 100644 --- a/tests/test-sources/plugins/by-name/glow/default.nix +++ b/tests/test-sources/plugins/by-name/glow/default.nix @@ -1,4 +1,3 @@ -{ pkgs, ... }: { empty = { plugins.glow.enable = true; @@ -8,8 +7,6 @@ plugins.glow = { enable = true; - glowPackage = pkgs.glow; - settings = { glow_path.__raw = "vim.fn.exepath('glow')"; install_path = "~/.local/bin";