diff --git a/examples/check-utils/flake.lock b/examples/check-utils/flake.lock new file mode 100644 index 0000000..5e07108 --- /dev/null +++ b/examples/check-utils/flake.lock @@ -0,0 +1,56 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 0, + "narHash": "sha256-omjHh3LT883xERMxVEXH/oeAFI2pAAy30mhZb0eN5G4=", + "path": "../..", + "type": "path" + }, + "original": { + "path": "../..", + "type": "path" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1685498995, + "narHash": "sha256-rdyjnkq87tJp+T2Bm1OD/9NXKSsh/vLlPeqCc/mm7qs=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "9cfaa8a1a00830d17487cb60a19bb86f96f09b27", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/examples/check-utils/flake.nix b/examples/check-utils/flake.nix index dbaa4f6..6e31013 100644 --- a/examples/check-utils/flake.nix +++ b/examples/check-utils/flake.nix @@ -1,19 +1,28 @@ { description = "Flake utils demo"; - inputs.flake-utils.url = "github:numtide/flake-utils"; + inputs.flake-utils.url = "path:../.."; outputs = { self, nixpkgs, flake-utils }: flake-utils.lib.eachDefaultSystem (system: let inherit (flake-utils.lib.check-utils system) isEqual hasKey; testDataset = { key1 = "value1"; key2 = 123; key3 = "some>value with^invalid&characters"; }; + mkHydraJobs = system: { + toplevel = derivation { name = "toplevel"; builder = "mybuilder"; inherit system; }; + nested = { + attribute = derivation { name = "nested-attribute"; builder = "mybuilder"; inherit system; }; + }; + }; in rec { + hydraJobs = mkHydraJobs system; checks = { # Successful cases success_isEqual = isEqual testDataset.key1 "value1"; success_hasKey = hasKey testDataset "key2"; + # ensure no special handling of hydraJobs + success_hydraJobs = isEqual self.hydraJobs (flake-utils.lib.eachDefaultSystemMap mkHydraJobs); # Failing cases failure_isEqual = isEqual testDataset.key1 "failing-data";