mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-20 16:15:43 +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
30
modules/dependencies.nix
Normal file
30
modules/dependencies.nix
Normal file
|
@ -0,0 +1,30 @@
|
|||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.dependencies;
|
||||
|
||||
packages = {
|
||||
curl.default = "curl";
|
||||
};
|
||||
|
||||
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))
|
||||
];
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue