lib/meta.nix: allow patterns over entire platform, not just .parsed
This commit is contained in:
parent
778419b9e6
commit
1690aa6858
1 changed files with 5 additions and 1 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue