nix-community.nixvim/modules/dependencies.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

37 lines
664 B
Nix
Raw Normal View History

2025-04-06 17:17:51 +02:00
{
lib,
config,
pkgs,
...
}:
let
cfg = config.dependencies;
packages = {
curl.default = "curl";
2025-04-06 17:21:24 +02:00
git = {
default = "git";
example = [ "gitMinimal" ];
};
2025-04-06 17:21:36 +02:00
ueberzug.default = "ueberzugpp";
2025-04-07 15:49:34 +02:00
which.default = "which";
2025-04-06 17:17:51 +02:00
};
mkDependencyOption = name: properties: {
enable = lib.mkEnableOption "Add ${name} to dependencies.";
package = lib.mkPackageOption pkgs name properties;
};
in
{
options.dependencies = lib.mapAttrs mkDependencyOption packages;
config = {
extraPackages = lib.pipe cfg [
builtins.attrValues
(builtins.filter (p: p.enable))
(builtins.map (p: p.package))
];
};
}