mirror of
https://github.com/nix-community/nixvim.git
synced 2025-07-25 13:14:37 +02:00
modules/dependencies: refactor all-examples
test
Embed the original `path` as an attr in the literal expression, so that we don't need to convert back from human readable paths in the test.
This commit is contained in:
parent
1095b7f891
commit
16879e3034
2 changed files with 23 additions and 7 deletions
|
@ -30,12 +30,14 @@
|
|||
}:
|
||||
{
|
||||
dependencies = lib.pipe options.dependencies [
|
||||
(lib.filterAttrs (_: depOption: depOption.package ? example))
|
||||
# We use a literalExpression example, with an additional `path` attr.
|
||||
# This means we don't have to convert human readable paths back to list-paths for this test.
|
||||
(lib.filterAttrs (_: depOption: depOption.package ? example.path))
|
||||
(lib.mapAttrs (
|
||||
_: depOption:
|
||||
let
|
||||
packageName = depOption.package.example.text;
|
||||
packagePath = lib.splitString "." packageName;
|
||||
packagePath = depOption.package.example.path;
|
||||
packageName = lib.showAttrPath packagePath;
|
||||
package = lib.attrByPath packagePath (throw "${packageName} not found in pkgs") pkgs;
|
||||
in
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue