mirror of
https://github.com/nix-community/nixvim.git
synced 2025-07-24 04:35:08 +02:00
modules/dependencies: init + add curl
This commit is contained in:
parent
33c3f98fdc
commit
cfd4b61262
11 changed files with 97 additions and 28 deletions
|
@ -1,7 +1,6 @@
|
|||
{
|
||||
lib,
|
||||
helpers,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
|
@ -12,13 +11,15 @@ lib.nixvim.plugins.mkNeovimPlugin {
|
|||
|
||||
maintainers = [ maintainers.GaetanLepage ];
|
||||
|
||||
extraOptions = {
|
||||
curlPackage = lib.mkPackageOption pkgs "curl" {
|
||||
nullable = true;
|
||||
};
|
||||
};
|
||||
# TODO: added 2025-04-06, remove after 25.05
|
||||
imports = [
|
||||
(lib.nixvim.mkRemovedPackageOptionModule {
|
||||
plugin = "chatgpt";
|
||||
packageName = "curl";
|
||||
})
|
||||
];
|
||||
|
||||
extraConfig = cfg: { extraPackages = [ cfg.curlPackage ]; };
|
||||
extraConfig = cfg: { dependencies.curl.enable = lib.mkDefault true; };
|
||||
|
||||
settingsOptions = {
|
||||
api_key_cmd = helpers.defaultNullOpts.mkStr null ''
|
||||
|
|
|
@ -14,7 +14,8 @@ lib.nixvim.plugins.mkNeovimPlugin {
|
|||
|
||||
maintainers = [ lib.maintainers.GaetanLepage ];
|
||||
|
||||
# TODO: Added 2025-03-20. Remove after 25.05
|
||||
# TODO: option deprecations added 2025-03-20. Remove after 25.05
|
||||
# TODO: curlPackage deprecation added 2025-04-06. Remove after 25.05
|
||||
inherit (import ./deprecations.nix lib)
|
||||
deprecateExtraOptions
|
||||
optionsRenamedToSettings
|
||||
|
@ -22,10 +23,6 @@ lib.nixvim.plugins.mkNeovimPlugin {
|
|||
;
|
||||
|
||||
extraOptions = {
|
||||
curlPackage = lib.mkPackageOption pkgs "curl" {
|
||||
nullable = true;
|
||||
};
|
||||
|
||||
ueberzugPackage = lib.mkOption {
|
||||
type = with types; nullOr package;
|
||||
default = pkgs.ueberzugpp;
|
||||
|
@ -140,11 +137,10 @@ lib.nixvim.plugins.mkNeovimPlugin {
|
|||
};
|
||||
|
||||
extraConfig = cfg: {
|
||||
extraPackages = [
|
||||
# In theory, we could remove that if the user explicitly disables `downloadRemoteImages` for
|
||||
# all integrations but shipping `curl` is not too heavy.
|
||||
cfg.curlPackage
|
||||
# In theory, we could remove that if the user explicitly disables `downloadRemoteImages` for
|
||||
# all integrations but shipping `curl` is not too heavy.
|
||||
dependencies.curl.enable = lib.mkDefault true;
|
||||
|
||||
] ++ lib.optional (cfg.settings.backend == "ueberzug") cfg.ueberzugPackage;
|
||||
extraPackages = lib.optional (cfg.settings.backend == "ueberzug") cfg.ueberzugPackage;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -17,5 +17,10 @@ lib: {
|
|||
Nixvim(plugins.image): The option `integrations` has been renamed to `settings.integrations`.
|
||||
Warning: sub-options now have the same name as upstream (`clear_in_insert_mode`...).
|
||||
'')
|
||||
|
||||
(lib.nixvim.mkRemovedPackageOptionModule {
|
||||
plugin = "image";
|
||||
packageName = "curl";
|
||||
})
|
||||
];
|
||||
}
|
||||
|
|
|
@ -40,6 +40,12 @@ lib.nixvim.plugins.mkNeovimPlugin {
|
|||
Refer to the documentation for more information.
|
||||
''
|
||||
)
|
||||
|
||||
# TODO: added 2025-04-06: remove after 25.05
|
||||
(lib.nixvim.mkRemovedPackageOptionModule {
|
||||
plugin = "rest";
|
||||
packageName = "curl";
|
||||
})
|
||||
]
|
||||
++
|
||||
map
|
||||
|
@ -207,10 +213,6 @@ lib.nixvim.plugins.mkNeovimPlugin {
|
|||
};
|
||||
|
||||
extraOptions = {
|
||||
curlPackage = lib.mkPackageOption pkgs "curl" {
|
||||
nullable = true;
|
||||
};
|
||||
|
||||
enableHttpFiletypeAssociation = lib.mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
|
@ -300,7 +302,7 @@ lib.nixvim.plugins.mkNeovimPlugin {
|
|||
|
||||
globals.rest_nvim = cfg.settings;
|
||||
|
||||
extraPackages = [ cfg.curlPackage ];
|
||||
dependencies.curl.enable = lib.mkDefault true;
|
||||
|
||||
filetype = lib.mkIf cfg.enableHttpFiletypeAssociation {
|
||||
extension.http = "http";
|
||||
|
|
|
@ -11,10 +11,6 @@ lib.nixvim.plugins.mkNeovimPlugin {
|
|||
maintainers = [ lib.maintainers.GaetanLepage ];
|
||||
|
||||
extraOptions = {
|
||||
curlPackage = lib.mkPackageOption pkgs "curl" {
|
||||
nullable = true;
|
||||
};
|
||||
|
||||
gitPackage = lib.mkPackageOption pkgs "git" {
|
||||
nullable = true;
|
||||
};
|
||||
|
@ -22,9 +18,9 @@ lib.nixvim.plugins.mkNeovimPlugin {
|
|||
|
||||
extraConfig = cfg: {
|
||||
extraPackages = [
|
||||
cfg.curlPackage
|
||||
cfg.gitPackage
|
||||
];
|
||||
dependencies.curl.enable = lib.mkDefault true;
|
||||
};
|
||||
|
||||
settingsExample = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue