diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/get-tests.nix | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/get-tests.nix b/lib/get-tests.nix new file mode 100644 index 00000000..22d85b12 --- /dev/null +++ b/lib/get-tests.nix @@ -0,0 +1,18 @@ +{ system ? builtins.currentSystem, nixpkgs ? import ../nixpkgs-path.nix }: + +with import "${nixpkgs}/lib"; + +{ + nixos = let + upstreamTests = (import "${nixpkgs}/nixos/release.nix" { + inherit nixpkgs; + }).tests; + isTestOrSystems = attr: attr ? test || attr ? ${system}; + cond = attr: !isTestOrSystems attr; + reduce = attr: if attr ? test then attr else attr.${system}; + in mapAttrsRecursiveCond cond (path: reduce) upstreamTests; + + vuizvui = import ../tests { + inherit system; + }; +} |