diff options
author | Florian Klink <flokli@flokli.de> | 2023-01-30 21:13:15 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-30 21:13:15 +0100 |
commit | 31931ffc350ef628e264c01b7cd21c7b92390bc9 (patch) | |
tree | e0c061c3e8e2904eba6c6a543d7997cd2e41c610 /lib/systems/inspect.nix | |
parent | b334fb7feb80b81017379f4eb128bc18def5666f (diff) | |
parent | 9c0a3417c8defd0b5f4b592659c88c978f8b36b6 (diff) |
Merge pull request #212939 from amjoseph-nixpkgs/pr/isStatic
meta: replace predicates with pattern over elaborated platform
Diffstat (limited to 'lib/systems/inspect.nix')
-rw-r--r-- | lib/systems/inspect.nix | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/systems/inspect.nix b/lib/systems/inspect.nix index b40a82b3321e8..c3ed528682657 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 = mapAttrs (_: p: { parsed = {}; } // p) { + isStatic = { isStatic = true; }; + }; } |