mirror of
https://github.com/nix-community/nixvim.git
synced 2025-08-02 09:04:54 +02:00
tests/dependencies: extend the disabled logic to the "examples" test case
This commit is contained in:
parent
91073486b2
commit
7a58109958
1 changed files with 22 additions and 13 deletions
|
@ -1,3 +1,22 @@
|
|||
{
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
disabledDeps = [
|
||||
];
|
||||
|
||||
inherit (pkgs.stdenv) hostPlatform;
|
||||
|
||||
isDepEnabled =
|
||||
name: package:
|
||||
# Filter disabled dependencies
|
||||
(!lib.elem name disabledDeps)
|
||||
|
||||
# Disable if the package is not compatible with hostPlatform
|
||||
&& lib.meta.availableOn hostPlatform package;
|
||||
in
|
||||
{
|
||||
override =
|
||||
{ pkgs, ... }:
|
||||
|
@ -16,18 +35,8 @@
|
|||
...
|
||||
}:
|
||||
let
|
||||
inherit (pkgs.stdenv) hostPlatform;
|
||||
|
||||
disabled = [
|
||||
];
|
||||
|
||||
enableDep = depName: depOption: {
|
||||
enable =
|
||||
# Filter disabled dependencies
|
||||
(!lib.elem depName disabled)
|
||||
|
||||
# Disable if the package is not compatible with hostPlatform
|
||||
&& lib.meta.availableOn hostPlatform depOption.package.default;
|
||||
enable = isDepEnabled depName depOption.package.default;
|
||||
};
|
||||
in
|
||||
{
|
||||
|
@ -47,14 +56,14 @@
|
|||
# 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:
|
||||
depName: depOption:
|
||||
let
|
||||
packagePath = depOption.package.example.path;
|
||||
packageName = lib.showAttrPath packagePath;
|
||||
package = lib.attrByPath packagePath (throw "${packageName} not found in pkgs") pkgs;
|
||||
in
|
||||
{
|
||||
enable = lib.meta.availableOn pkgs.stdenv.hostPlatform package;
|
||||
enable = isDepEnabled depName package;
|
||||
inherit package;
|
||||
}
|
||||
))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue