Revert "lib/meta.nix: platformMatch: allow predicate functions"

This reverts commit b7d097438b.
This commit is contained in:
Adam Joseph 2023-01-27 01:49:39 -08:00
parent 6821903540
commit 778419b9e6
2 changed files with 2 additions and 7 deletions

View File

@ -78,15 +78,10 @@ rec {
2. (modern) a pattern for the platform `parsed` field.
3. (functional) a predicate function returning a boolean.
We can inject these into a pattern for the whole of a structured platform,
and then match that.
*/
platformMatch = platform: elem:
if builtins.isFunction elem
then elem platform
else let
platformMatch = platform: elem: let
pattern =
if builtins.isString elem
then { system = elem; }

View File

@ -271,7 +271,7 @@ let
sourceProvenance = listOf lib.types.attrs;
maintainers = listOf (attrsOf anything); # TODO use the maintainer type from lib/tests/maintainer-module.nix
priority = int;
platforms = listOf (oneOf [ str (attrsOf anything) (functionTo bool) ]); # see lib.meta.platformMatch
platforms = listOf (either str (attrsOf anything)); # see lib.meta.platformMatch
hydraPlatforms = listOf str;
broken = bool;
unfree = bool;