diff --git a/modules/dependencies.nix b/modules/dependencies.nix index c257c800..e20ab28f 100644 --- a/modules/dependencies.nix +++ b/modules/dependencies.nix @@ -9,6 +9,10 @@ let packages = { curl.default = "curl"; + git = { + default = "git"; + example = [ "gitMinimal" ]; + }; ueberzug.default = "ueberzugpp"; }; diff --git a/plugins/by-name/committia/default.nix b/plugins/by-name/committia/default.nix index 25aaad45..4915e8e4 100644 --- a/plugins/by-name/committia/default.nix +++ b/plugins/by-name/committia/default.nix @@ -1,6 +1,5 @@ { lib, - pkgs, ... }: let @@ -14,6 +13,14 @@ lib.nixvim.plugins.mkVimPlugin { maintainers = [ lib.maintainers.alisonjenkins ]; + imports = [ + # TODO: added 2025-04-06, remove after 25.05 + (lib.nixvim.mkRemovedPackageOptionModule { + plugin = "committia"; + packageName = "git"; + }) + ]; + settingsOptions = { open_only_vim_starting = defaultNullOpts.mkFlagInt 1 '' If `0`, committia.vim always attempts to open committia's buffer when `COMMIT_EDITMSG` buffer is opened. @@ -49,13 +56,7 @@ lib.nixvim.plugins.mkVimPlugin { ''; }; - extraOptions = { - gitPackage = lib.mkPackageOption pkgs "git" { - nullable = true; - }; - }; - extraConfig = cfg: { - extraPackages = [ cfg.gitPackage ]; + dependencies.git.enable = lib.mkDefault true; }; } diff --git a/plugins/by-name/fugitive/default.nix b/plugins/by-name/fugitive/default.nix index 8bdc60d1..481c04d5 100644 --- a/plugins/by-name/fugitive/default.nix +++ b/plugins/by-name/fugitive/default.nix @@ -1,7 +1,5 @@ { lib, - helpers, - pkgs, ... }: lib.nixvim.plugins.mkVimPlugin { @@ -11,14 +9,17 @@ lib.nixvim.plugins.mkVimPlugin { maintainers = [ lib.maintainers.GaetanLepage ]; - # In typical tpope fashion, this plugin has no config options - extraOptions = { - gitPackage = lib.mkPackageOption pkgs "git" { - nullable = true; - }; - }; + imports = [ + # TODO: added 2025-04-07, remove after 25.05 + (lib.nixvim.mkRemovedPackageOptionModule { + plugin = "fugitive"; + packageName = "git"; + }) + ]; - extraConfig = cfg: { - extraPackages = [ cfg.gitPackage ]; + # In typical tpope fashion, this plugin has no config options + + extraConfig = { + dependencies.git.enable = lib.mkDefault true; }; } diff --git a/plugins/by-name/git-conflict/default.nix b/plugins/by-name/git-conflict/default.nix index 4bfaac72..87ff3d5e 100644 --- a/plugins/by-name/git-conflict/default.nix +++ b/plugins/by-name/git-conflict/default.nix @@ -1,7 +1,6 @@ { lib, helpers, - pkgs, ... }: with lib; @@ -11,13 +10,17 @@ lib.nixvim.plugins.mkNeovimPlugin { maintainers = [ maintainers.GaetanLepage ]; - extraOptions = { - gitPackage = lib.mkPackageOption pkgs "git" { - nullable = true; - }; - }; + imports = [ + # TODO: added 2025-04-07, remove after 25.05 + (lib.nixvim.mkRemovedPackageOptionModule { + plugin = "git-conflict"; + packageName = "git"; + }) + ]; - extraConfig = cfg: { extraPackages = [ cfg.gitPackage ]; }; + extraConfig = { + dependencies.git.enable = lib.mkDefault true; + }; settingsOptions = { default_mappings = diff --git a/plugins/by-name/git-worktree/default.nix b/plugins/by-name/git-worktree/default.nix index b4ec53a4..3daba895 100644 --- a/plugins/by-name/git-worktree/default.nix +++ b/plugins/by-name/git-worktree/default.nix @@ -1,7 +1,6 @@ { lib, config, - pkgs, ... }: let @@ -14,6 +13,14 @@ lib.nixvim.plugins.mkNeovimPlugin { maintainers = [ lib.maintainers.khaneliman ]; + # TODO: added 2025-04-06, remove after 25.05 + imports = [ + (lib.nixvim.mkRemovedPackageOptionModule { + plugin = "git-worktree"; + packageName = "git"; + }) + ]; + settingsOptions = { change_directory_command = defaultNullOpts.mkStr "cd" '' The vim command used to change to the new worktree directory. @@ -50,10 +57,6 @@ lib.nixvim.plugins.mkNeovimPlugin { extraOptions = { enableTelescope = lib.mkEnableOption "telescope integration"; - - gitPackage = lib.mkPackageOption pkgs "git" { - nullable = true; - }; }; callSetup = false; @@ -67,7 +70,7 @@ lib.nixvim.plugins.mkNeovimPlugin { ''; }; - extraPackages = [ cfg.gitPackage ]; + dependencies.git.enable = lib.mkDefault true; plugins.telescope.enabledExtensions = lib.mkIf cfg.enableTelescope [ "git_worktree" ]; diff --git a/plugins/by-name/gitblame/default.nix b/plugins/by-name/gitblame/default.nix index 15bab057..280b6165 100644 --- a/plugins/by-name/gitblame/default.nix +++ b/plugins/by-name/gitblame/default.nix @@ -1,6 +1,5 @@ { lib, - pkgs, ... }: let @@ -26,6 +25,13 @@ lib.nixvim.plugins.mkNeovimPlugin { "delay" "virtualTextColumn" ]; + imports = [ + # TODO: added 2025-04-07, remove after 25.05 + (lib.nixvim.mkRemovedPackageOptionModule { + plugin = "gitblame"; + packageName = "git"; + }) + ]; settingsOptions = { enabled = defaultNullOpts.mkBool true '' @@ -127,11 +133,7 @@ lib.nixvim.plugins.mkNeovimPlugin { use_blame_commit_file_urls = true; }; - extraOptions = { - gitPackage = lib.mkPackageOption pkgs "git" { - nullable = true; - }; + extraConfig = { + dependencies.git.enable = lib.mkDefault true; }; - - extraConfig = cfg: { extraPackages = [ cfg.gitPackage ]; }; } diff --git a/plugins/by-name/gitgutter/default.nix b/plugins/by-name/gitgutter/default.nix index d5c2397c..a41be9b3 100644 --- a/plugins/by-name/gitgutter/default.nix +++ b/plugins/by-name/gitgutter/default.nix @@ -35,6 +35,12 @@ lib.nixvim.plugins.mkVimPlugin { "modifiedAbove" ] ) "This option has been removed from upstream") + + # TODO: added 2025-04-06, remove after 25.05 + (lib.nixvim.mkRemovedPackageOptionModule { + plugin = "gitgutter"; + packageName = "git"; + }) ]; extraOptions = { @@ -46,10 +52,6 @@ lib.nixvim.plugins.mkVimPlugin { ''; }; - gitPackage = lib.mkPackageOption pkgs "git" { - nullable = true; - }; - grepPackage = lib.mkPackageOption pkgs "gnugrep" { nullable = true; }; @@ -61,8 +63,9 @@ lib.nixvim.plugins.mkVimPlugin { foldtext = "gitgutter#fold#foldtext"; }; + dependencies.git.enable = lib.mkDefault true; + extraPackages = [ - cfg.gitPackage cfg.grepPackage ]; }; diff --git a/plugins/by-name/gitmessenger/default.nix b/plugins/by-name/gitmessenger/default.nix index d0793bf4..7f2aa750 100644 --- a/plugins/by-name/gitmessenger/default.nix +++ b/plugins/by-name/gitmessenger/default.nix @@ -1,6 +1,5 @@ { lib, - pkgs, ... }: let @@ -15,14 +14,8 @@ lib.nixvim.plugins.mkVimPlugin { maintainers = [ lib.maintainers.GaetanLepage ]; - extraOptions = { - gitPackage = lib.mkPackageOption pkgs "git" { - nullable = true; - }; - }; - - extraConfig = cfg: { - extraPackages = [ cfg.gitPackage ]; + extraConfig = { + dependencies.git.enable = lib.mkDefault true; }; # TODO: Added 2024-12-16; remove after 25.05 @@ -42,6 +35,13 @@ lib.nixvim.plugins.mkVimPlugin { "floatingWinOps" "popupContentMargins" ]; + imports = [ + # TODO: added 2025-04-07, remove after 25.05 + (lib.nixvim.mkRemovedPackageOptionModule { + plugin = "gitmessenger"; + packageName = "git"; + }) + ]; settingsOptions = { close_on_cursor_moved = defaultNullOpts.mkBool true '' diff --git a/plugins/by-name/gitsigns/default.nix b/plugins/by-name/gitsigns/default.nix index 79a921f3..4860535e 100644 --- a/plugins/by-name/gitsigns/default.nix +++ b/plugins/by-name/gitsigns/default.nix @@ -74,13 +74,13 @@ lib.nixvim.plugins.mkNeovimPlugin { "enable" ] ) "yadm support was removed upstream.") - ]; - extraOptions = { - gitPackage = lib.mkPackageOption pkgs "git" { - nullable = true; - }; - }; + # TODO: added 2025-04-06, remove after 25.05 + (lib.nixvim.mkRemovedPackageOptionModule { + plugin = "gitsigns"; + packageName = "git"; + }) + ]; settingsOptions = import ./settings-options.nix lib; @@ -112,6 +112,6 @@ lib.nixvim.plugins.mkNeovimPlugin { ''; }; - extraPackages = [ cfg.gitPackage ]; + dependencies.git.enable = lib.mkDefault true; }; } diff --git a/plugins/by-name/lazygit/default.nix b/plugins/by-name/lazygit/default.nix index 2f656f91..4c41ad5c 100644 --- a/plugins/by-name/lazygit/default.nix +++ b/plugins/by-name/lazygit/default.nix @@ -15,6 +15,14 @@ lib.nixvim.plugins.mkVimPlugin { maintainers = [ lib.maintainers.AndresBermeoMarinelli ]; + imports = [ + # TODO: added 2025-04-07, remove after 25.05 + (lib.nixvim.mkRemovedPackageOptionModule { + plugin = "lazygit"; + packageName = "git"; + }) + ]; + settingsOptions = { floating_window_winblend = defaultNullOpts.mkNullable (types.ints.between 0 100) 0 '' Set the transparency of the floating window. @@ -71,18 +79,15 @@ lib.nixvim.plugins.mkVimPlugin { }; extraOptions = { - gitPackage = lib.mkPackageOption pkgs "git" { - nullable = true; - }; - lazygitPackage = lib.mkPackageOption pkgs "lazygit" { nullable = true; }; }; extraConfig = cfg: { + dependencies.git.enable = lib.mkDefault true; + extraPackages = [ - cfg.gitPackage cfg.lazygitPackage ]; }; diff --git a/plugins/by-name/lualine/default.nix b/plugins/by-name/lualine/default.nix index 8598f806..222552b9 100644 --- a/plugins/by-name/lualine/default.nix +++ b/plugins/by-name/lualine/default.nix @@ -43,7 +43,14 @@ lib.nixvim.plugins.mkNeovimPlugin { "alwaysDivideMiddle" ]; in - mkSettingsRenamedOptionModules basePluginPath optionsPath oldOptions; + (mkSettingsRenamedOptionModules basePluginPath optionsPath oldOptions) + ++ [ + # TODO: added 2025-04-06, remove after 25.05 + (lib.nixvim.mkRemovedPackageOptionModule { + plugin = "lualine"; + packageName = "git"; + }) + ]; settingsOptions = let @@ -400,13 +407,7 @@ lib.nixvim.plugins.mkNeovimPlugin { }; }; - extraOptions = { - gitPackage = lib.mkPackageOption pkgs "git" { - nullable = true; - }; - }; - - extraConfig = cfg: { - extraPackages = [ cfg.gitPackage ]; + extraConfig = { + dependencies.git.enable = lib.mkDefault true; }; } diff --git a/plugins/by-name/neo-tree/default.nix b/plugins/by-name/neo-tree/default.nix index 2e2d6598..ec77c445 100644 --- a/plugins/by-name/neo-tree/default.nix +++ b/plugins/by-name/neo-tree/default.nix @@ -3,7 +3,6 @@ helpers, config, pkgs, - options, ... }: with lib; @@ -26,6 +25,12 @@ in (mkRemovedOptionModule ( basePluginPath ++ [ "closeFloatsOnEscapeKey" ] ) "This option has been removed from upstream.") + + # TODO: added 2025-04-07, remove after 25.05 + (lib.nixvim.mkRemovedPackageOptionModule { + plugin = "neo-tree"; + packageName = "git"; + }) ]; options.plugins.neo-tree = let @@ -63,10 +68,6 @@ in ]; }; - gitPackage = lib.mkPackageOption pkgs "git" { - nullable = true; - }; - sources = helpers.defaultNullOpts.mkListOf types.str [ @@ -1139,6 +1140,6 @@ in require('neo-tree').setup(${lib.nixvim.toLuaObject setupOptions}) ''; - extraPackages = [ cfg.gitPackage ]; + dependencies.git.enable = lib.mkDefault true; }; } diff --git a/plugins/by-name/neogit/default.nix b/plugins/by-name/neogit/default.nix index 3f018422..6a78efbc 100644 --- a/plugins/by-name/neogit/default.nix +++ b/plugins/by-name/neogit/default.nix @@ -14,7 +14,18 @@ lib.nixvim.plugins.mkNeovimPlugin { # TODO introduced 2024-02-29: remove 2024-04-29 deprecateExtraOptions = true; imports = - map + [ + # TODO: added 2025-04-07, remove after 25.05 + (lib.nixvim.mkRemovedPackageOptionModule { + plugin = "neogit"; + packageName = "git"; + }) + (lib.nixvim.mkRemovedPackageOptionModule { + plugin = "neogit"; + packageName = "which"; + }) + ] + ++ (map ( optionPath: mkRemovedOptionModule @@ -40,7 +51,8 @@ lib.nixvim.plugins.mkNeovimPlugin { "sections" "unpulled" ] - ]; + ] + ); optionsRenamedToSettings = [ "disableSigns" "disableHint" @@ -101,10 +113,6 @@ lib.nixvim.plugins.mkNeovimPlugin { }; extraOptions = { - gitPackage = lib.mkPackageOption pkgs "git" { - nullable = true; - }; - whichPackage = lib.mkPackageOption pkgs "which" { nullable = true; }; @@ -132,13 +140,10 @@ lib.nixvim.plugins.mkNeovimPlugin { ] ); - extraPackages = - [ - cfg.gitPackage - ] - ++ optional (hasInfix "which" ( - cfg.settings.commit_view.verify_commit.__raw or "" - )) cfg.whichPackage; + dependencies.git.enable = lib.mkDefault true; + extraPackages = optional (hasInfix "which" ( + cfg.settings.commit_view.verify_commit.__raw or "" + )) cfg.whichPackage; }; } diff --git a/plugins/by-name/nvim-tree/default.nix b/plugins/by-name/nvim-tree/default.nix index d858746c..a13c5dbb 100644 --- a/plugins/by-name/nvim-tree/default.nix +++ b/plugins/by-name/nvim-tree/default.nix @@ -35,6 +35,12 @@ in "view" "hideRootFolder" ] "Set `plugins.nvim-tree.renderer.rootFolderLabel` to `false` to hide the root folder.") + + # TODO: added 2025-04-07, remove after 25.05 + (lib.nixvim.mkRemovedPackageOptionModule { + plugin = "nvim-tree"; + packageName = "git"; + }) ]; options.plugins.nvim-tree = lib.nixvim.plugins.neovim.extraOptionsOptions // { enable = mkEnableOption "nvim-tree"; @@ -46,10 +52,6 @@ in ]; }; - gitPackage = lib.mkPackageOption pkgs "git" { - nullable = true; - }; - disableNetrw = helpers.defaultNullOpts.mkBool false "Disable netrw"; hijackNetrw = helpers.defaultNullOpts.mkBool true "Hijack netrw"; @@ -1192,6 +1194,6 @@ in require('nvim-tree').setup(${lib.nixvim.toLuaObject setupOptions}) ''; - extraPackages = [ cfg.gitPackage ]; + dependencies.git.enable = lib.mkDefault true; }; } diff --git a/plugins/by-name/pckr/default.nix b/plugins/by-name/pckr/default.nix index 9c999097..d8493d5e 100644 --- a/plugins/by-name/pckr/default.nix +++ b/plugins/by-name/pckr/default.nix @@ -1,6 +1,5 @@ { lib, - pkgs, ... }: let @@ -13,11 +12,15 @@ lib.nixvim.plugins.mkNeovimPlugin { maintainers = [ lib.maintainers.GaetanLepage ]; - extraOptions = { - gitPackage = lib.mkPackageOption pkgs "git" { - nullable = true; - }; + imports = [ + # TODO: added 2025-04-07, remove after 25.05 + (lib.nixvim.mkRemovedPackageOptionModule { + plugin = "pckr"; + packageName = "git"; + }) + ]; + extraOptions = { plugins = lib.mkOption { default = [ ]; type = @@ -75,7 +78,7 @@ lib.nixvim.plugins.mkNeovimPlugin { }; extraConfig = cfg: { - extraPackages = [ cfg.gitPackage ]; + dependencies.git.enable = lib.mkDefault true; plugins.pckr.luaConfig = { # Otherwise pckr can't find itself diff --git a/plugins/by-name/tinygit/default.nix b/plugins/by-name/tinygit/default.nix index 472c603d..85691713 100644 --- a/plugins/by-name/tinygit/default.nix +++ b/plugins/by-name/tinygit/default.nix @@ -1,6 +1,5 @@ { lib, - pkgs, ... }: lib.nixvim.plugins.mkNeovimPlugin { @@ -10,17 +9,11 @@ lib.nixvim.plugins.mkNeovimPlugin { maintainers = [ lib.maintainers.GaetanLepage ]; - extraOptions = { - gitPackage = lib.mkPackageOption pkgs "git" { - nullable = true; - }; - }; - extraConfig = cfg: { - extraPackages = [ - cfg.gitPackage - ]; - dependencies.curl.enable = lib.mkDefault true; + dependencies = { + curl.enable = lib.mkDefault true; + git.enable = lib.mkDefault true; + }; }; settingsExample = { diff --git a/plugins/pluginmanagers/lazy.nix b/plugins/pluginmanagers/lazy.nix index c35bfe46..d041ff05 100644 --- a/plugins/pluginmanagers/lazy.nix +++ b/plugins/pluginmanagers/lazy.nix @@ -37,6 +37,14 @@ let lazyPath = pkgs.linkFarm "lazy-plugins" processedPlugins; in { + # TODO: added 2025-04-06, remove after 25.05 + imports = [ + (lib.nixvim.mkRemovedPackageOptionModule { + plugin = "lazy"; + packageName = "git"; + }) + ]; + options = { plugins.lazy = { enable = mkEnableOption "lazy.nvim"; @@ -46,10 +54,6 @@ in "lazy-nvim" ] { }; - gitPackage = lib.mkPackageOption pkgs "git" { - nullable = true; - }; - plugins = with types; let @@ -162,7 +166,7 @@ in config = mkIf cfg.enable { extraPlugins = [ cfg.package ]; - extraPackages = [ cfg.gitPackage ]; + dependencies.git.enable = lib.mkDefault true; extraConfigLua = let diff --git a/tests/test-sources/plugins/by-name/committia/default.nix b/tests/test-sources/plugins/by-name/committia/default.nix index 39ad9b39..f2687ee4 100644 --- a/tests/test-sources/plugins/by-name/committia/default.nix +++ b/tests/test-sources/plugins/by-name/committia/default.nix @@ -21,9 +21,8 @@ }; no-packages = { - plugins.committia = { - enable = true; - gitPackage = null; - }; + plugins.committia.enable = true; + + dependencies.git.enable = false; }; } diff --git a/tests/test-sources/plugins/by-name/git-worktree/default.nix b/tests/test-sources/plugins/by-name/git-worktree/default.nix index bda9091a..ed1f7fdc 100644 --- a/tests/test-sources/plugins/by-name/git-worktree/default.nix +++ b/tests/test-sources/plugins/by-name/git-worktree/default.nix @@ -33,9 +33,8 @@ }; no-packages = { - plugins.git-worktree = { - enable = true; - gitPackage = null; - }; + dependencies.git.enable = false; + + plugins.git-worktree.enable = true; }; } diff --git a/tests/test-sources/plugins/by-name/gitgutter/default.nix b/tests/test-sources/plugins/by-name/gitgutter/default.nix index 76236e22..8a25c334 100644 --- a/tests/test-sources/plugins/by-name/gitgutter/default.nix +++ b/tests/test-sources/plugins/by-name/gitgutter/default.nix @@ -84,13 +84,15 @@ { plugins.gitgutter = { enable = true; - gitPackage = null; grepPackage = null; settings = { git_executable = lib.getExe pkgs.git; grep = lib.getExe pkgs.gnugrep; }; }; + + dependencies.git.enable = false; + assertions = [ { assertion = lib.all (x: x.pname or null != "git") config.extraPackages; diff --git a/tests/test-sources/plugins/by-name/lualine/default.nix b/tests/test-sources/plugins/by-name/lualine/default.nix index 7c656f71..2eb392e9 100644 --- a/tests/test-sources/plugins/by-name/lualine/default.nix +++ b/tests/test-sources/plugins/by-name/lualine/default.nix @@ -152,9 +152,8 @@ }; no-packages = { - plugins.lualine = { - enable = true; - gitPackage = null; - }; + plugins.lualine.enable = true; + + dependencies.git.enable = false; }; } diff --git a/tests/test-sources/plugins/by-name/neo-tree/default.nix b/tests/test-sources/plugins/by-name/neo-tree/default.nix index 8226d00e..ca3ec9f8 100644 --- a/tests/test-sources/plugins/by-name/neo-tree/default.nix +++ b/tests/test-sources/plugins/by-name/neo-tree/default.nix @@ -441,11 +441,12 @@ }; no-packages = { - plugins.web-devicons.enable = false; - plugins.neo-tree = { - enable = true; - gitPackage = null; + plugins = { + web-devicons.enable = true; + neo-tree.enable = true; }; + + dependencies.git.enable = false; }; no-icons = { diff --git a/tests/test-sources/plugins/by-name/neogit/default.nix b/tests/test-sources/plugins/by-name/neogit/default.nix index a3c1c19b..19dc590c 100644 --- a/tests/test-sources/plugins/by-name/neogit/default.nix +++ b/tests/test-sources/plugins/by-name/neogit/default.nix @@ -296,8 +296,9 @@ no-packages = { plugins.neogit = { enable = true; - gitPackage = null; whichPackage = null; }; + + dependencies.git.enable = false; }; } diff --git a/tests/test-sources/plugins/by-name/nvim-tree/default.nix b/tests/test-sources/plugins/by-name/nvim-tree/default.nix index 07bf19e1..0d40aa28 100644 --- a/tests/test-sources/plugins/by-name/nvim-tree/default.nix +++ b/tests/test-sources/plugins/by-name/nvim-tree/default.nix @@ -260,10 +260,11 @@ }; no-packages = { - plugins.web-devicons.enable = true; - plugins.nvim-tree = { - enable = true; - gitPackage = null; + plugins = { + web-devicons.enable = true; + nvim-tree.enable = true; }; + + dependencies.git.enable = false; }; } diff --git a/tests/test-sources/plugins/by-name/pckr/default.nix b/tests/test-sources/plugins/by-name/pckr/default.nix index 846eaad2..f20d49bf 100644 --- a/tests/test-sources/plugins/by-name/pckr/default.nix +++ b/tests/test-sources/plugins/by-name/pckr/default.nix @@ -118,9 +118,8 @@ }; no-packages = { - plugins.pckr = { - enable = true; - gitPackage = null; - }; + plugins.pckr.enable = true; + + dependencies.git.enable = false; }; } diff --git a/tests/test-sources/plugins/pluginmanagers/lazy.nix b/tests/test-sources/plugins/pluginmanagers/lazy.nix index 90c0bdb3..663a74cb 100644 --- a/tests/test-sources/plugins/pluginmanagers/lazy.nix +++ b/tests/test-sources/plugins/pluginmanagers/lazy.nix @@ -91,9 +91,7 @@ }; no-packages = { - plugins.lazy = { - enable = true; - gitPackage = null; - }; + dependencies.git.enable = false; + plugins.lazy.enable = true; }; }