From 1690aa6858102c0986075f460f93d693c724327b Mon Sep 17 00:00:00 2001 From: Adam Joseph Date: Fri, 27 Jan 2023 02:19:30 -0800 Subject: [PATCH] lib/meta.nix: allow patterns over entire platform, not just `.parsed` --- lib/meta.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/meta.nix b/lib/meta.nix index 62894aeb316b..40d6948ebdc7 100644 --- a/lib/meta.nix +++ b/lib/meta.nix @@ -76,7 +76,9 @@ rec { 1. (legacy) a system string. - 2. (modern) a pattern for the platform `parsed` field. + 2. (modern) a pattern for the entire platform structure. + + 3. (modern) a pattern for the platform `parsed` field. We can inject these into a pattern for the whole of a structured platform, and then match that. @@ -85,6 +87,8 @@ rec { pattern = if builtins.isString elem then { system = elem; } + else if elem?parsed + then elem else { parsed = elem; }; in lib.matchAttrs pattern platform;