---
Function {
 argument: None,
 arguments: FunctionArguments {
  arguments: [
   FunctionArgument {
    identifier: "lib",
    default: None,
   },
   FunctionArgument {
    identifier: "pkgs",
    default: None,
   },
   FunctionArgument {
    identifier: "config",
    default: None,
   },
  ],
  ellipsis: true,
 },
 definition: With {
  expression: Variable {
   identifier: "lib",
   position: (3, 6),
  },
  target: Map {
   bindings: [
    KeyValue(
     AttributePath {
      attributes: [
       Raw {
        content: "imports",
        position: (6, 3),
       },
      ],
     },
     List {
      elements: [
       FunctionApplication {
        function: Variable {
         identifier: "mkRenamedOptionModule",
         position: (7, 6),
        },
        arguments: [
         List {
          elements: [
           String {
            parts: [
             Raw {
              content: "services",
              position: (7, 31),
             },
            ],
           },
           String {
            parts: [
             Raw {
              content: "flatpak",
              position: (7, 42),
             },
            ],
           },
           String {
            parts: [
             Raw {
              content: "extraPortals",
              position: (7, 52),
             },
            ],
           },
          ],
          position: (7, 28),
         },
         List {
          elements: [
           String {
            parts: [
             Raw {
              content: "xdg",
              position: (7, 71),
             },
            ],
           },
           String {
            parts: [
             Raw {
              content: "portal",
              position: (7, 77),
             },
            ],
           },
           String {
            parts: [
             Raw {
              content: "extraPortals",
              position: (7, 86),
             },
            ],
           },
          ],
          position: (7, 68),
         },
        ],
       },
      ],
      position: (6, 13),
     },
    ),
    KeyValue(
     AttributePath {
      attributes: [
       Raw {
        content: "meta",
        position: (10, 3),
       },
      ],
     },
     Map {
      bindings: [
       KeyValue(
        AttributePath {
         attributes: [
          Raw {
           content: "maintainers",
           position: (11, 5),
          },
         ],
        },
        PropertyAccess {
         expression: Variable {
          identifier: "teams",
          position: (11, 19),
         },
         attribute_path: AttributePath {
          attributes: [
           Raw {
            content: "freedesktop",
            position: (11, 25),
           },
           Raw {
            content: "members",
            position: (11, 37),
           },
          ],
         },
         default: None,
        },
       ),
      ],
      recursive: false,
      position: (10, 10),
     },
    ),
    KeyValue(
     AttributePath {
      attributes: [
       Raw {
        content: "options",
        position: (14, 3),
       },
       Raw {
        content: "xdg",
        position: (14, 11),
       },
       Raw {
        content: "portal",
        position: (14, 15),
       },
      ],
     },
     Map {
      bindings: [
       KeyValue(
        AttributePath {
         attributes: [
          Raw {
           content: "enable",
           position: (15, 5),
          },
         ],
        },
        BinaryOperation {
         operator: Update,
         operands: [
          FunctionApplication {
           function: Variable {
            identifier: "mkEnableOption",
            position: (16, 7),
           },
           arguments: [
            String {
             parts: [
              Raw {
               content: "<link xlink:href='https://github.com/flatpak/xdg-desktop-portal'>xdg desktop integration</link>",
               position: (16, 23),
              },
             ],
            },
           ],
          },
          Map {
           bindings: [
            KeyValue(
             AttributePath {
              attributes: [
               Raw {
                content: "default",
                position: (17, 9),
               },
              ],
             },
             Variable {
              identifier: "false",
              position: (17, 19),
             },
            ),
           ],
           recursive: false,
           position: (16, 123),
          },
         ],
         position: (16, 120),
        },
       ),
       KeyValue(
        AttributePath {
         attributes: [
          Raw {
           content: "extraPortals",
           position: (20, 5),
          },
         ],
        },
        FunctionApplication {
         function: Variable {
          identifier: "mkOption",
          position: (20, 20),
         },
         arguments: [
          Map {
           bindings: [
            KeyValue(
             AttributePath {
              attributes: [
               Raw {
                content: "type",
                position: (21, 7),
               },
              ],
             },
             FunctionApplication {
              function: PropertyAccess {
               expression: Variable {
                identifier: "types",
                position: (21, 14),
               },
               attribute_path: AttributePath {
                attributes: [
                 Raw {
                  content: "listOf",
                  position: (21, 20),
                 },
                ],
               },
               default: None,
              },
              arguments: [
               PropertyAccess {
                expression: Variable {
                 identifier: "types",
                 position: (21, 27),
                },
                attribute_path: AttributePath {
                 attributes: [
                  Raw {
                   content: "package",
                   position: (21, 33),
                  },
                 ],
                },
                default: None,
               },
              ],
             },
            ),
            KeyValue(
             AttributePath {
              attributes: [
               Raw {
                content: "default",
                position: (22, 7),
               },
              ],
             },
             List {
              elements: [],
              position: (22, 17),
             },
            ),
            KeyValue(
             AttributePath {
              attributes: [
               Raw {
                content: "description",
                position: (23, 7),
               },
              ],
             },
             String {
              parts: [
               Raw {
                content: "List of additional portals to add to path. Portals allow interaction\nwith system, like choosing files or taking screenshots. At minimum,\na desktop portal implementation should be listed. GNOME and KDE already\nadds <package>xdg-desktop-portal-gtk</package>; and\n<package>xdg-desktop-portal-kde</package> respectively. On other desktop\nenvironments you probably want to add them yourself.\n",
                position: (24, 1),
               },
              ],
             },
            ),
           ],
           recursive: false,
           position: (20, 29),
          },
         ],
        },
       ),
       KeyValue(
        AttributePath {
         attributes: [
          Raw {
           content: "gtkUsePortal",
           position: (33, 5),
          },
         ],
        },
        FunctionApplication {
         function: Variable {
          identifier: "mkOption",
          position: (33, 20),
         },
         arguments: [
          Map {
           bindings: [
            KeyValue(
             AttributePath {
              attributes: [
               Raw {
                content: "type",
                position: (34, 7),
               },
              ],
             },
             PropertyAccess {
              expression: Variable {
               identifier: "types",
               position: (34, 14),
              },
              attribute_path: AttributePath {
               attributes: [
                Raw {
                 content: "bool",
                 position: (34, 20),
                },
               ],
              },
              default: None,
             },
            ),
            KeyValue(
             AttributePath {
              attributes: [
               Raw {
                content: "default",
                position: (35, 7),
               },
              ],
             },
             Variable {
              identifier: "false",
              position: (35, 17),
             },
            ),
            KeyValue(
             AttributePath {
              attributes: [
               Raw {
                content: "description",
                position: (36, 7),
               },
              ],
             },
             String {
              parts: [
               Raw {
                content: "Sets environment variable <literal>GTK_USE_PORTAL</literal> to <literal>1</literal>.\nThis is needed for packages ran outside Flatpak to respect and use XDG Desktop Portals.\nFor example, you'd need to set this for non-flatpak Firefox to use native filechoosers.\nDefaults to <literal>false</literal> to respect its opt-in nature.\n",
                position: (37, 1),
               },
              ],
             },
            ),
           ],
           recursive: false,
           position: (33, 29),
          },
         ],
        },
       ),
      ],
      recursive: false,
      position: (14, 24),
     },
    ),
    KeyValue(
     AttributePath {
      attributes: [
       Raw {
        content: "config",
        position: (45, 3),
       },
      ],
     },
     LetIn {
      bindings: [
       KeyValue(
        AttributePath {
         attributes: [
          Raw {
           content: "cfg",
           position: (47, 7),
          },
         ],
        },
        PropertyAccess {
         expression: Variable {
          identifier: "config",
          position: (47, 13),
         },
         attribute_path: AttributePath {
          attributes: [
           Raw {
            content: "xdg",
            position: (47, 20),
           },
           Raw {
            content: "portal",
            position: (47, 24),
           },
          ],
         },
         default: None,
        },
       ),
       KeyValue(
        AttributePath {
         attributes: [
          Raw {
           content: "packages",
           position: (48, 7),
          },
         ],
        },
        BinaryOperation {
         operator: Concatenation,
         operands: [
          List {
           elements: [
            PropertyAccess {
             expression: Variable {
              identifier: "pkgs",
              position: (48, 20),
             },
             attribute_path: AttributePath {
              attributes: [
               Raw {
                content: "xdg-desktop-portal",
                position: (48, 25),
               },
              ],
             },
             default: None,
            },
           ],
           position: (48, 18),
          },
          PropertyAccess {
           expression: Variable {
            identifier: "cfg",
            position: (48, 49),
           },
           attribute_path: AttributePath {
            attributes: [
             Raw {
              content: "extraPortals",
              position: (48, 53),
             },
            ],
           },
           default: None,
          },
         ],
         position: (48, 46),
        },
       ),
       KeyValue(
        AttributePath {
         attributes: [
          Raw {
           content: "joinedPortals",
           position: (49, 7),
          },
         ],
        },
        FunctionApplication {
         function: PropertyAccess {
          expression: Variable {
           identifier: "pkgs",
           position: (49, 23),
          },
          attribute_path: AttributePath {
           attributes: [
            Raw {
             content: "buildEnv",
             position: (49, 28),
            },
           ],
          },
          default: None,
         },
         arguments: [
          Map {
           bindings: [
            KeyValue(
             AttributePath {
              attributes: [
               Raw {
                content: "name",
                position: (50, 9),
               },
              ],
             },
             String {
              parts: [
               Raw {
                content: "xdg-portals",
                position: (50, 17),
               },
              ],
             },
            ),
            KeyValue(
             AttributePath {
              attributes: [
               Raw {
                content: "paths",
                position: (51, 9),
               },
              ],
             },
             Variable {
              identifier: "packages",
              position: (51, 17),
             },
            ),
            KeyValue(
             AttributePath {
              attributes: [
               Raw {
                content: "pathsToLink",
                position: (52, 9),
               },
              ],
             },
             List {
              elements: [
               String {
                parts: [
                 Raw {
                  content: "/share/xdg-desktop-portal/portals",
                  position: (52, 26),
                 },
                ],
               },
               String {
                parts: [
                 Raw {
                  content: "/share/applications",
                  position: (52, 62),
                 },
                ],
               },
              ],
              position: (52, 23),
             },
            ),
           ],
           recursive: false,
           position: (49, 37),
          },
         ],
        },
       ),
      ],
      target: FunctionApplication {
       function: Variable {
        identifier: "mkIf",
        position: (56, 5),
       },
       arguments: [
        PropertyAccess {
         expression: Variable {
          identifier: "cfg",
          position: (56, 10),
         },
         attribute_path: AttributePath {
          attributes: [
           Raw {
            content: "enable",
            position: (56, 14),
           },
          ],
         },
         default: None,
        },
        Map {
         bindings: [
          KeyValue(
           AttributePath {
            attributes: [
             Raw {
              content: "assertions",
              position: (58, 7),
             },
            ],
           },
           List {
            elements: [
             Map {
              bindings: [
               KeyValue(
                AttributePath {
                 attributes: [
                  Raw {
                   content: "assertion",
                   position: (60, 11),
                  },
                 ],
                },
                BinaryOperation {
                 operator: NotEqualTo,
                 operands: [
                  PropertyAccess {
                   expression: Variable {
                    identifier: "cfg",
                    position: (60, 23),
                   },
                   attribute_path: AttributePath {
                    attributes: [
                     Raw {
                      content: "extraPortals",
                      position: (60, 27),
                     },
                    ],
                   },
                   default: None,
                  },
                  List {
                   elements: [],
                   position: (60, 43),
                  },
                 ],
                 position: (60, 40),
                },
               ),
               KeyValue(
                AttributePath {
                 attributes: [
                  Raw {
                   content: "message",
                   position: (61, 11),
                  },
                 ],
                },
                String {
                 parts: [
                  Raw {
                   content: "Setting xdg.portal.enable to true requires a portal implementation in xdg.portal.extraPortals such as xdg-desktop-portal-gtk or xdg-desktop-portal-kde.",
                   position: (61, 22),
                  },
                 ],
                },
               ),
              ],
              recursive: false,
              position: (59, 9),
             },
            ],
            position: (58, 20),
           },
          ),
          KeyValue(
           AttributePath {
            attributes: [
             Raw {
              content: "services",
              position: (65, 7),
             },
             Raw {
              content: "dbus",
              position: (65, 16),
             },
             Raw {
              content: "packages",
              position: (65, 21),
             },
            ],
           },
           Variable {
            identifier: "packages",
            position: (65, 32),
           },
          ),
          KeyValue(
           AttributePath {
            attributes: [
             Raw {
              content: "systemd",
              position: (66, 7),
             },
             Raw {
              content: "packages",
              position: (66, 15),
             },
            ],
           },
           Variable {
            identifier: "packages",
            position: (66, 26),
           },
          ),
          KeyValue(
           AttributePath {
            attributes: [
             Raw {
              content: "environment",
              position: (68, 7),
             },
            ],
           },
           Map {
            bindings: [
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "systemPackages",
                 position: (72, 9),
                },
               ],
              },
              List {
               elements: [
                Variable {
                 identifier: "joinedPortals",
                 position: (72, 28),
                },
               ],
               position: (72, 26),
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "pathsToLink",
                 position: (73, 9),
                },
               ],
              },
              List {
               elements: [
                String {
                 parts: [
                  Raw {
                   content: "/share/applications",
                   position: (73, 26),
                  },
                 ],
                },
               ],
               position: (73, 23),
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "sessionVariables",
                 position: (75, 9),
                },
               ],
              },
              Map {
               bindings: [
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "GTK_USE_PORTAL",
                    position: (76, 11),
                   },
                  ],
                 },
                 FunctionApplication {
                  function: Variable {
                   identifier: "mkIf",
                   position: (76, 28),
                  },
                  arguments: [
                   PropertyAccess {
                    expression: Variable {
                     identifier: "cfg",
                     position: (76, 33),
                    },
                    attribute_path: AttributePath {
                     attributes: [
                      Raw {
                       content: "gtkUsePortal",
                       position: (76, 37),
                      },
                     ],
                    },
                    default: None,
                   },
                   String {
                    parts: [
                     Raw {
                      content: "1",
                      position: (76, 51),
                     },
                    ],
                   },
                  ],
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "XDG_DESKTOP_PORTAL_DIR",
                    position: (77, 11),
                   },
                  ],
                 },
                 String {
                  parts: [
                   Expression {
                    expression: Variable {
                     identifier: "joinedPortals",
                     position: (77, 39),
                    },
                   },
                   Raw {
                    content: "/share/xdg-desktop-portal/portals",
                    position: (77, 53),
                   },
                  ],
                 },
                ),
               ],
               recursive: false,
               position: (75, 28),
              },
             ),
            ],
            recursive: false,
            position: (68, 21),
           },
          ),
         ],
         recursive: false,
         position: (56, 21),
        },
       ],
      },
      position: (46, 5),
     },
    ),
   ],
   recursive: false,
   position: (5, 1),
  },
  position: (3, 1),
 },
 position: (1, 1),
}