mirror of
https://github.com/numtide/flake-utils.git
synced 2024-11-30 09:58:19 +03:00
98c8d36b18
* Add checks-utils overlay Add checks-utils overlay Fix example flake inputs Fix string expected exception * Update check-utils implementation * nixpkgs-fmt
30 lines
922 B
Nix
30 lines
922 B
Nix
{
|
|
description = "Flake utils demo";
|
|
|
|
inputs.flake-utils.url = "github:numtide/flake-utils";
|
|
|
|
outputs = { self, nixpkgs, flake-utils }:
|
|
flake-utils.lib.eachDefaultSystem (system:
|
|
let
|
|
inherit (flake-utils.lib.check-utils system) isEqual hasKey;
|
|
|
|
testDataset = { key1 = "value1"; key2 = "value2"; key3 = "value3"; };
|
|
in
|
|
rec {
|
|
checks = {
|
|
valid_key1 = isEqual testDataset.key1 "value1";
|
|
contains_key2 = hasKey testDataset "key2";
|
|
|
|
failing_valid_key1 = isEqual testDataset.key1 "failing-data";
|
|
failing_contains_key2 = hasKey testDataset "failing-data";
|
|
|
|
number_formatting_isEqual = isEqual testDataset.key1 123;
|
|
number_formatting_hasKey = hasKey testDataset 123;
|
|
|
|
null_formatting_key1 = isEqual testDataset.key1 null;
|
|
null_formatting_hasKey = hasKey testDataset null;
|
|
};
|
|
}
|
|
);
|
|
}
|