mirror of
https://github.com/nix-community/nixvim.git
synced 2025-08-04 01:55:11 +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 =
|
override =
|
||||||
{ pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
|
@ -16,18 +35,8 @@
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
inherit (pkgs.stdenv) hostPlatform;
|
|
||||||
|
|
||||||
disabled = [
|
|
||||||
];
|
|
||||||
|
|
||||||
enableDep = depName: depOption: {
|
enableDep = depName: depOption: {
|
||||||
enable =
|
enable = isDepEnabled depName depOption.package.default;
|
||||||
# Filter disabled dependencies
|
|
||||||
(!lib.elem depName disabled)
|
|
||||||
|
|
||||||
# Disable if the package is not compatible with hostPlatform
|
|
||||||
&& lib.meta.availableOn hostPlatform depOption.package.default;
|
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
@ -47,14 +56,14 @@
|
||||||
# This means we don't have to convert human readable paths back to list-paths for this test.
|
# 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.filterAttrs (_: depOption: depOption.package ? example.path))
|
||||||
(lib.mapAttrs (
|
(lib.mapAttrs (
|
||||||
_: depOption:
|
depName: depOption:
|
||||||
let
|
let
|
||||||
packagePath = depOption.package.example.path;
|
packagePath = depOption.package.example.path;
|
||||||
packageName = lib.showAttrPath packagePath;
|
packageName = lib.showAttrPath packagePath;
|
||||||
package = lib.attrByPath packagePath (throw "${packageName} not found in pkgs") pkgs;
|
package = lib.attrByPath packagePath (throw "${packageName} not found in pkgs") pkgs;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
enable = lib.meta.availableOn pkgs.stdenv.hostPlatform package;
|
enable = isDepEnabled depName package;
|
||||||
inherit package;
|
inherit package;
|
||||||
}
|
}
|
||||||
))
|
))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue