From 2bf826c902e462d54a22e6302dc5079d2dfc4b74 Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Thu, 26 Mar 2026 12:47:43 +0100 Subject: [PATCH] nixos/release: respect `meta.hydraPlatforms` from NixOS tests E.g. nspawn tests are not supported on the official NixOS infrastructure currently. --- nixos/release.nix | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/nixos/release.nix b/nixos/release.nix index 2778972742c9..3d750086cf4b 100644 --- a/nixos/release.nix +++ b/nixos/release.nix @@ -43,12 +43,17 @@ let pkgs = import ./.. { inherit system; }; callTest = config: - if attrNamesOnly then - hydraJob config.test - else - { - ${system} = hydraJob config.test; - }; + let + inherit (config) test; + in + lib.optionalAttrs (builtins.elem system (getPlatforms test)) ( + if attrNamesOnly then + hydraJob test + else + { + ${system} = hydraJob test; + } + ); } // { # for typechecking of the scripts and evaluation of @@ -58,12 +63,17 @@ let pkgs = import ./.. { inherit system; }; callTest = config: - if attrNamesOnly then - hydraJob config.driver - else - { - ${system} = hydraJob config.driver; - }; + let + inherit (config) driver; + in + lib.optionalAttrs (builtins.elem system (getPlatforms driver)) ( + if attrNamesOnly then + hydraJob driver + else + { + ${system} = hydraJob driver; + } + ); }; };