From 35da03c549a9d9a4ce0c2affef95ec97ae5a42f3 Mon Sep 17 00:00:00 2001 From: Ryan Burns Date: Sun, 6 Nov 2022 15:44:00 -0800 Subject: [PATCH] Add additional examples and clarifications for syntax rules --- rfcs/0110-inherit-as-list.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/rfcs/0110-inherit-as-list.md b/rfcs/0110-inherit-as-list.md index 025a2f6..bb46790 100644 --- a/rfcs/0110-inherit-as-list.md +++ b/rfcs/0110-inherit-as-list.md @@ -94,6 +94,20 @@ meta.licenses = lib.licenses.[ bsd3 mit ]; meta.maintainers = lib.maintainers.[ johndoe janedoe ]; ``` +Note that only simple textual attrnames are allowed in the square brackets. +For example, `pkgs.[ (openssl.overrideAttrs { patches = [ ... ]; }) ]` +is currently a syntax error, as is `pkgs.[ "${some_expression}" ]`, +`a.[ b.[ c d ] ]`, and `a.[ [ b c ] [ d e ] ]`. +Future RFCs may add additional support for useful idioms such as +`pkgs.[ python310 python310Packages.pytorch ]` on a case-by-case basis, +but that is not planned for this RFC. + +Other forms of syntax which were considered but are not proposed +in this RFC include: +* `[ inherit (attrs) a b c; ]` +* `[ inherit a b c; ]` +* `inherit (attrs) [ a b c ]` +* `pkgs.{ python = python310; openssl = openssl_3; }` # Drawbacks [drawbacks]: #drawbacks