diff --git a/t/jobs/basic.nix b/t/jobs/basic.nix index 9e207f80..31b613f5 100644 --- a/t/jobs/basic.nix +++ b/t/jobs/basic.nix @@ -1,4 +1,6 @@ -with import ./config.nix; +{ system ? builtins.currentSystem }: + +with import ./config.nix { inherit system; }; { empty_dir = mkDerivation { diff --git a/t/jobs/config.nix.in b/t/jobs/config.nix.in index 41776341..9f9ecbf0 100644 --- a/t/jobs/config.nix.in +++ b/t/jobs/config.nix.in @@ -1,9 +1,11 @@ +{ system ? builtins.currentSystem }: + rec { path = "@testPath@"; mkDerivation = args: derivation ({ - system = builtins.currentSystem; + inherit system; PATH = path; } // args); mkContentAddressedDerivation = args: mkDerivation ({ diff --git a/t/jobs/flake-checks/flake.nix b/t/jobs/flake-checks/flake.nix index 489fa9ec..f5609a9d 100644 --- a/t/jobs/flake-checks/flake.nix +++ b/t/jobs/flake-checks/flake.nix @@ -1,6 +1,11 @@ { - outputs = { ... }: { - checks = - import ./basic.nix; - }; + outputs = { self, ... }: + let + systems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ]; + forAllSystems = f: builtins.listToAttrs (map (system: { name = system; value = f system; }) systems); + in { + checks = forAllSystems (system: + import ./basic.nix { inherit system; } + ); + }; } diff --git a/t/jobs/flake-hydraJobs/flake.nix b/t/jobs/flake-hydraJobs/flake.nix index c02ccddd..5e9b41c6 100644 --- a/t/jobs/flake-hydraJobs/flake.nix +++ b/t/jobs/flake-hydraJobs/flake.nix @@ -1,6 +1,11 @@ { - outputs = { ... }: { - hydraJobs = - import ./basic.nix; - }; + outputs = { self, ... }: + let + systems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ]; + forAllSystems = f: builtins.listToAttrs (map (system: { name = system; value = f system; }) systems); + in { + hydraJobs = forAllSystems (system: + import ./basic.nix { inherit system; } + ); + }; }