nix-module-wrapper-manager-fds/tests/default.nix

36 lines
830 B
Nix
Raw Permalink Normal View History

let
sources = import ../npins;
in
2024-07-31 13:51:40 +00:00
{
pkgs ? import sources.nixos-unstable { },
}:
let
wrapperManagerLibTests = import ./lib { inherit pkgs; };
inherit (pkgs) lib;
in
{
2025-01-12 09:58:39 +00:00
configs =
let
configs' = import ./configs { inherit pkgs; };
updateTestName =
configName: package:
lib.mapAttrs' (n: v: lib.nameValuePair "${configName}-${n}" v) package.wrapperManagerTests;
in
lib.concatMapAttrs updateTestName configs';
lib =
2024-07-31 13:51:40 +00:00
pkgs.runCommand "wrapper-manager-fds-lib-test"
{
testData = builtins.toJSON wrapperManagerLibTests;
2024-07-31 13:51:40 +00:00
passAsFile = [ "testData" ];
nativeBuildInputs = with pkgs; [
yajsv
jq
];
}
''
yajsv -s "${./lib/tests.schema.json}" "$testDataPath" && touch $out || jq . "$testDataPath"
'';
}