From ea0bcf25053464a9f0483c3b2f411275de036e57 Mon Sep 17 00:00:00 2001 From: Adam Joseph Date: Fri, 27 Jan 2023 02:19:54 -0800 Subject: [PATCH] lib/systems/inspect.nix: add platformPatterns.isStatic --- lib/systems/inspect.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/systems/inspect.nix b/lib/systems/inspect.nix index a5fed5acf2c5..65a9100f1993 100644 --- a/lib/systems/inspect.nix +++ b/lib/systems/inspect.nix @@ -7,6 +7,7 @@ let abis_ = abis; in let abis = lib.mapAttrs (_: abi: builtins.removeAttrs abi [ "assertions" ]) abis_; in rec { + # these patterns are to be matched against {host,build,target}Platform.parsed patterns = rec { isi686 = { cpu = cpuTypes.i686; }; isx86_32 = { cpu = { family = "x86"; bits = 32; }; }; @@ -90,4 +91,13 @@ rec { else matchAttrs patterns; predicates = mapAttrs (_: matchAnyAttrs) patterns; + + # these patterns are to be matched against the entire + # {host,build,target}Platform structure; they include a `parsed={}` marker so + # that `lib.meta.availableOn` can distinguish them from the patterns which + # apply only to the `parsed` field. + + platformPatterns = { + isStatic = { parsed = {}; isStatic = true; }; + }; }