2024-08-01 02:59:26 +00:00
|
|
|
# This is the unit cases for our Nix project. It should only require a nixpkgs
|
|
|
|
# instance and we'll have to make it easy to test between the unstable and
|
|
|
|
# stable version of home-manager and NixOS.
|
|
|
|
{ branch ? "stable", system ? builtins.currentSystem }:
|
2024-02-24 10:48:07 +00:00
|
|
|
|
2024-06-05 13:16:01 +00:00
|
|
|
let
|
|
|
|
sources = import ../npins;
|
2024-08-01 02:59:26 +00:00
|
|
|
pkgs = import sources."nixos-${branch}" { inherit system; };
|
|
|
|
bahaghariLib = import ./lib { inherit pkgs; };
|
2024-06-05 13:16:01 +00:00
|
|
|
in
|
2024-02-24 10:48:07 +00:00
|
|
|
{
|
2024-08-01 02:59:26 +00:00
|
|
|
lib = bahaghariLib;
|
|
|
|
libTestPkg =
|
|
|
|
pkgs.runCommand "bahaghari-lib-test"
|
|
|
|
{
|
|
|
|
testData = builtins.toJSON bahaghariLib;
|
|
|
|
passAsFile = [ "testData" ];
|
|
|
|
nativeBuildInputs = with pkgs; [
|
|
|
|
yajsv
|
|
|
|
jq
|
|
|
|
];
|
|
|
|
}
|
|
|
|
''
|
|
|
|
yajsv -s "${./lib/tests.schema.json}" "$testDataPath" && touch $out || jq . "$testDataPath"
|
|
|
|
'';
|
2024-02-24 10:48:07 +00:00
|
|
|
#modules = import ./modules { inherit pkgs; };
|
|
|
|
}
|