mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 00:25:42 +02:00
tests/modules/dependencies: test all package examples
This commit is contained in:
parent
e9a85eed8b
commit
72ce6dbdf5
1 changed files with 25 additions and 0 deletions
|
@ -20,4 +20,29 @@
|
||||||
enable = lib.meta.availableOn pkgs.stdenv.hostPlatform depOption.package.default;
|
enable = lib.meta.availableOn pkgs.stdenv.hostPlatform depOption.package.default;
|
||||||
}) options.dependencies;
|
}) options.dependencies;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
all-examples =
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
options,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
dependencies = lib.pipe options.dependencies [
|
||||||
|
(lib.filterAttrs (_: depOption: depOption.package ? example))
|
||||||
|
(lib.mapAttrs (
|
||||||
|
_: depOption:
|
||||||
|
let
|
||||||
|
packageName = depOption.package.example.text;
|
||||||
|
packagePath = lib.splitString "." packageName;
|
||||||
|
package = lib.attrByPath packagePath (throw "${packageName} not found in pkgs") pkgs;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
enable = lib.meta.availableOn pkgs.stdenv.hostPlatform package;
|
||||||
|
inherit package;
|
||||||
|
}
|
||||||
|
))
|
||||||
|
];
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue