---
Function {
 argument: None,
 arguments: FunctionArguments {
  arguments: [
   FunctionArgument {
    identifier: "options",
    default: None,
   },
   FunctionArgument {
    identifier: "pkgs",
    default: None,
   },
   FunctionArgument {
    identifier: "lib",
    default: None,
   },
   FunctionArgument {
    identifier: "config",
    default: None,
   },
  ],
  ellipsis: false,
 },
 definition: With {
  expression: Variable {
   identifier: "lib",
   position: (3, 6),
  },
  target: LetIn {
   bindings: [
    KeyValue(
     AttributePath {
      attributes: [
       Raw {
        content: "cfg",
        position: (6, 3),
       },
      ],
     },
     PropertyAccess {
      expression: Variable {
       identifier: "config",
       position: (6, 9),
      },
      attribute_path: AttributePath {
       attributes: [
        Raw {
         content: "services",
         position: (6, 16),
        },
        Raw {
         content: "prometheus",
         position: (6, 25),
        },
        Raw {
         content: "exporters",
         position: (6, 36),
        },
        Raw {
         content: "buildkite-agent",
         position: (6, 46),
        },
       ],
      },
      default: None,
     },
    ),
   ],
   target: Map {
    bindings: [
     KeyValue(
      AttributePath {
       attributes: [
        Raw {
         content: "port",
         position: (9, 3),
        },
       ],
      },
      Int {
       value: 9876,
       position: (9, 10),
      },
     ),
     KeyValue(
      AttributePath {
       attributes: [
        Raw {
         content: "extraOpts",
         position: (10, 3),
        },
       ],
      },
      Map {
       bindings: [
        KeyValue(
         AttributePath {
          attributes: [
           Raw {
            content: "tokenPath",
            position: (11, 5),
           },
          ],
         },
         FunctionApplication {
          function: Variable {
           identifier: "mkOption",
           position: (11, 17),
          },
          arguments: [
           Map {
            bindings: [
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "type",
                 position: (12, 7),
                },
               ],
              },
              FunctionApplication {
               function: PropertyAccess {
                expression: Variable {
                 identifier: "types",
                 position: (12, 14),
                },
                attribute_path: AttributePath {
                 attributes: [
                  Raw {
                   content: "nullOr",
                   position: (12, 20),
                  },
                 ],
                },
                default: None,
               },
               arguments: [
                PropertyAccess {
                 expression: Variable {
                  identifier: "types",
                  position: (12, 27),
                 },
                 attribute_path: AttributePath {
                  attributes: [
                   Raw {
                    content: "path",
                    position: (12, 33),
                   },
                  ],
                 },
                 default: None,
                },
               ],
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "apply",
                 position: (13, 7),
                },
               ],
              },
              Function {
               argument: Some(
                "final",
               ),
               arguments: FunctionArguments {
                arguments: [],
                ellipsis: false,
               },
               definition: IfThenElse {
                predicate: BinaryOperation {
                 operator: EqualTo,
                 operands: [
                  Variable {
                   identifier: "final",
                   position: (13, 25),
                  },
                  Variable {
                   identifier: "null",
                   position: (13, 34),
                  },
                 ],
                 position: (13, 31),
                },
                then: Variable {
                 identifier: "null",
                 position: (13, 44),
                },
                else_: FunctionApplication {
                 function: Variable {
                  identifier: "toString",
                  position: (13, 54),
                 },
                 arguments: [
                  Variable {
                   identifier: "final",
                   position: (13, 63),
                  },
                 ],
                },
                position: (13, 22),
               },
               position: (13, 15),
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "description",
                 position: (14, 7),
                },
               ],
              },
              String {
               parts: [
                Raw {
                 content: "The token from your Buildkite \"Agents\" page.\n\nA run-time path to the token file, which is supposed to be provisioned\noutside of Nix store.\n",
                 position: (15, 1),
                },
               ],
              },
             ),
            ],
            recursive: false,
            position: (11, 26),
           },
          ],
         },
        ),
        KeyValue(
         AttributePath {
          attributes: [
           Raw {
            content: "interval",
            position: (21, 5),
           },
          ],
         },
         FunctionApplication {
          function: Variable {
           identifier: "mkOption",
           position: (21, 16),
          },
          arguments: [
           Map {
            bindings: [
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "type",
                 position: (22, 7),
                },
               ],
              },
              PropertyAccess {
               expression: Variable {
                identifier: "types",
                position: (22, 14),
               },
               attribute_path: AttributePath {
                attributes: [
                 Raw {
                  content: "str",
                  position: (22, 20),
                 },
                ],
               },
               default: None,
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "default",
                 position: (23, 7),
                },
               ],
              },
              String {
               parts: [
                Raw {
                 content: "30s",
                 position: (23, 18),
                },
               ],
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "example",
                 position: (24, 7),
                },
               ],
              },
              String {
               parts: [
                Raw {
                 content: "1min",
                 position: (24, 18),
                },
               ],
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "description",
                 position: (25, 7),
                },
               ],
              },
              String {
               parts: [
                Raw {
                 content: "How often to update metrics.\n",
                 position: (26, 1),
                },
               ],
              },
             ),
            ],
            recursive: false,
            position: (21, 25),
           },
          ],
         },
        ),
        KeyValue(
         AttributePath {
          attributes: [
           Raw {
            content: "endpoint",
            position: (29, 5),
           },
          ],
         },
         FunctionApplication {
          function: Variable {
           identifier: "mkOption",
           position: (29, 16),
          },
          arguments: [
           Map {
            bindings: [
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "type",
                 position: (30, 7),
                },
               ],
              },
              PropertyAccess {
               expression: Variable {
                identifier: "types",
                position: (30, 14),
               },
               attribute_path: AttributePath {
                attributes: [
                 Raw {
                  content: "str",
                  position: (30, 20),
                 },
                ],
               },
               default: None,
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "default",
                 position: (31, 7),
                },
               ],
              },
              String {
               parts: [
                Raw {
                 content: "https://agent.buildkite.com/v3",
                 position: (31, 18),
                },
               ],
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "description",
                 position: (32, 7),
                },
               ],
              },
              String {
               parts: [
                Raw {
                 content: "The Buildkite Agent API endpoint.\n",
                 position: (33, 1),
                },
               ],
              },
             ),
            ],
            recursive: false,
            position: (29, 25),
           },
          ],
         },
        ),
        KeyValue(
         AttributePath {
          attributes: [
           Raw {
            content: "queues",
            position: (36, 5),
           },
          ],
         },
         FunctionApplication {
          function: Variable {
           identifier: "mkOption",
           position: (36, 14),
          },
          arguments: [
           Map {
            bindings: [
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "type",
                 position: (37, 7),
                },
               ],
              },
              With {
               expression: Variable {
                identifier: "types",
                position: (37, 19),
               },
               target: FunctionApplication {
                function: Variable {
                 identifier: "nullOr",
                 position: (37, 26),
                },
                arguments: [
                 FunctionApplication {
                  function: Variable {
                   identifier: "listOf",
                   position: (37, 34),
                  },
                  arguments: [
                   Variable {
                    identifier: "str",
                    position: (37, 41),
                   },
                  ],
                 },
                ],
               },
               position: (37, 14),
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "default",
                 position: (38, 7),
                },
               ],
              },
              Variable {
               identifier: "null",
               position: (38, 17),
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "example",
                 position: (39, 7),
                },
               ],
              },
              FunctionApplication {
               function: Variable {
                identifier: "literalExpression",
                position: (39, 17),
               },
               arguments: [
                String {
                 parts: [
                  Raw {
                   content: "[ \"my-queue1\" \"my-queue2\" ]",
                   position: (39, 37),
                  },
                 ],
                },
               ],
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "description",
                 position: (40, 7),
                },
               ],
              },
              String {
               parts: [
                Raw {
                 content: "Which specific queues to process.\n",
                 position: (41, 1),
                },
               ],
              },
             ),
            ],
            recursive: false,
            position: (36, 23),
           },
          ],
         },
        ),
       ],
       recursive: false,
       position: (10, 15),
      },
     ),
     KeyValue(
      AttributePath {
       attributes: [
        Raw {
         content: "serviceOpts",
         position: (45, 3),
        },
       ],
      },
      Map {
       bindings: [
        KeyValue(
         AttributePath {
          attributes: [
           Raw {
            content: "script",
            position: (46, 5),
           },
          ],
         },
         LetIn {
          bindings: [
           KeyValue(
            AttributePath {
             attributes: [
              Raw {
               content: "queues",
               position: (48, 9),
              },
             ],
            },
            FunctionApplication {
             function: Variable {
              identifier: "concatStringsSep",
              position: (48, 18),
             },
             arguments: [
              String {
               parts: [
                Raw {
                 content: " ",
                 position: (48, 36),
                },
               ],
              },
              FunctionApplication {
               function: Variable {
                identifier: "map",
                position: (48, 40),
               },
               arguments: [
                Function {
                 argument: Some(
                  "q",
                 ),
                 arguments: FunctionArguments {
                  arguments: [],
                  ellipsis: false,
                 },
                 definition: String {
                  parts: [
                   Raw {
                    content: "-queue ",
                    position: (48, 49),
                   },
                   Expression {
                    expression: Variable {
                     identifier: "q",
                     position: (48, 58),
                    },
                   },
                  ],
                 },
                 position: (48, 45),
                },
                PropertyAccess {
                 expression: Variable {
                  identifier: "cfg",
                  position: (48, 63),
                 },
                 attribute_path: AttributePath {
                  attributes: [
                   Raw {
                    content: "queues",
                    position: (48, 67),
                   },
                  ],
                 },
                 default: None,
                },
               ],
              },
             ],
            },
           ),
          ],
          target: String {
           parts: [
            Raw {
             content: "export BUILDKITE_AGENT_TOKEN=\"$(cat ",
             position: (51, 1),
            },
            Expression {
             expression: FunctionApplication {
              function: Variable {
               identifier: "toString",
               position: (51, 47),
              },
              arguments: [
               PropertyAccess {
                expression: Variable {
                 identifier: "cfg",
                 position: (51, 56),
                },
                attribute_path: AttributePath {
                 attributes: [
                  Raw {
                   content: "tokenPath",
                   position: (51, 60),
                  },
                 ],
                },
                default: None,
               },
              ],
             },
            },
            Raw {
             content: ")\"\nexec ",
             position: (51, 70),
            },
            Expression {
             expression: PropertyAccess {
              expression: Variable {
               identifier: "pkgs",
               position: (52, 16),
              },
              attribute_path: AttributePath {
               attributes: [
                Raw {
                 content: "buildkite-agent-metrics",
                 position: (52, 21),
                },
               ],
              },
              default: None,
             },
            },
            Raw {
             content: "/bin/buildkite-agent-metrics \\\n  -backend prometheus \\\n  -interval ",
             position: (52, 45),
            },
            Expression {
             expression: PropertyAccess {
              expression: Variable {
               identifier: "cfg",
               position: (54, 23),
              },
              attribute_path: AttributePath {
               attributes: [
                Raw {
                 content: "interval",
                 position: (54, 27),
                },
               ],
              },
              default: None,
             },
            },
            Raw {
             content: " \\\n  -endpoint ",
             position: (54, 36),
            },
            Expression {
             expression: PropertyAccess {
              expression: Variable {
               identifier: "cfg",
               position: (55, 23),
              },
              attribute_path: AttributePath {
               attributes: [
                Raw {
                 content: "endpoint",
                 position: (55, 27),
                },
               ],
              },
              default: None,
             },
            },
            Raw {
             content: " \\\n  ",
             position: (55, 36),
            },
            Expression {
             expression: FunctionApplication {
              function: Variable {
               identifier: "optionalString",
               position: (56, 13),
              },
              arguments: [
               BinaryOperation {
                operator: NotEqualTo,
                operands: [
                 PropertyAccess {
                  expression: Variable {
                   identifier: "cfg",
                   position: (56, 29),
                  },
                  attribute_path: AttributePath {
                   attributes: [
                    Raw {
                     content: "queues",
                     position: (56, 33),
                    },
                   ],
                  },
                  default: None,
                 },
                 Variable {
                  identifier: "null",
                  position: (56, 43),
                 },
                ],
                position: (56, 40),
               },
               Variable {
                identifier: "queues",
                position: (56, 49),
               },
              ],
             },
            },
            Raw {
             content: " \\\n  -prometheus-addr \"",
             position: (56, 56),
            },
            Expression {
             expression: PropertyAccess {
              expression: Variable {
               identifier: "cfg",
               position: (57, 31),
              },
              attribute_path: AttributePath {
               attributes: [
                Raw {
                 content: "listenAddress",
                 position: (57, 35),
                },
               ],
              },
              default: None,
             },
            },
            Raw {
             content: ":",
             position: (57, 49),
            },
            Expression {
             expression: FunctionApplication {
              function: Variable {
               identifier: "toString",
               position: (57, 52),
              },
              arguments: [
               PropertyAccess {
                expression: Variable {
                 identifier: "cfg",
                 position: (57, 61),
                },
                attribute_path: AttributePath {
                 attributes: [
                  Raw {
                   content: "port",
                   position: (57, 65),
                  },
                 ],
                },
                default: None,
               },
              ],
             },
            },
            Raw {
             content: "\" ",
             position: (57, 70),
            },
            Expression {
             expression: FunctionApplication {
              function: Variable {
               identifier: "concatStringsSep",
               position: (57, 74),
              },
              arguments: [
               String {
                parts: [
                 Raw {
                  content: " ",
                  position: (57, 92),
                 },
                ],
               },
               PropertyAccess {
                expression: Variable {
                 identifier: "cfg",
                 position: (57, 95),
                },
                attribute_path: AttributePath {
                 attributes: [
                  Raw {
                   content: "extraFlags",
                   position: (57, 99),
                  },
                 ],
                },
                default: None,
               },
              ],
             },
            },
            Raw {
             content: "\n",
             position: (57, 110),
            },
           ],
          },
          position: (47, 7),
         },
        ),
        KeyValue(
         AttributePath {
          attributes: [
           Raw {
            content: "serviceConfig",
            position: (59, 5),
           },
          ],
         },
         Map {
          bindings: [
           KeyValue(
            AttributePath {
             attributes: [
              Raw {
               content: "DynamicUser",
               position: (60, 7),
              },
             ],
            },
            Variable {
             identifier: "false",
             position: (60, 21),
            },
           ),
           KeyValue(
            AttributePath {
             attributes: [
              Raw {
               content: "RuntimeDirectory",
               position: (61, 7),
              },
             ],
            },
            String {
             parts: [
              Raw {
               content: "buildkite-agent-metrics",
               position: (61, 27),
              },
             ],
            },
           ),
          ],
          recursive: false,
          position: (59, 21),
         },
        ),
       ],
       recursive: false,
       position: (45, 17),
      },
     ),
    ],
    recursive: false,
    position: (8, 1),
   },
   position: (5, 1),
  },
  position: (3, 1),
 },
 position: (1, 1),
}