diff options
author | Adam Joseph <adam@westernsemico.com> | 2023-01-27 02:19:30 -0800 |
---|---|---|
committer | Adam Joseph <adam@westernsemico.com> | 2023-01-27 02:19:30 -0800 |
commit | 1690aa6858102c0986075f460f93d693c724327b (patch) | |
tree | 4cc3073935c0dfc94b5d180d6dd1987c956a62db | |
parent | 778419b9e6e9d82d5801b382070a81169f5920ca (diff) | |
download | nixpkgs-1690aa6858102c0986075f460f93d693c724327b.tar nixpkgs-1690aa6858102c0986075f460f93d693c724327b.tar.gz nixpkgs-1690aa6858102c0986075f460f93d693c724327b.tar.bz2 nixpkgs-1690aa6858102c0986075f460f93d693c724327b.tar.lz nixpkgs-1690aa6858102c0986075f460f93d693c724327b.tar.xz nixpkgs-1690aa6858102c0986075f460f93d693c724327b.tar.zst nixpkgs-1690aa6858102c0986075f460f93d693c724327b.zip |
lib/meta.nix: allow patterns over entire platform, not just `.parsed`
-rw-r--r-- | lib/meta.nix | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/meta.nix b/lib/meta.nix index 62894aeb316..40d6948ebdc 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; |