---
Function {
 argument: Destructured {
  identifier: None,
  arguments: [
   DestructuredArgument {
    identifier: "config",
    default: None,
   },
   DestructuredArgument {
    identifier: "lib",
    default: None,
   },
   DestructuredArgument {
    identifier: "pkgs",
    default: None,
   },
   DestructuredArgument {
    identifier: "options",
    default: None,
   },
  ],
  ellipsis: false,
 },
 definition: With {
  expression: Variable {
   identifier: "lib",
   position: (3, 6),
  },
  target: LetIn {
   bindings: [
    Binding {
     from: AttributePath {
      parts: [
       Raw {
        content: "cfg",
        position: (6, 3),
       },
      ],
     },
     to: PropertyAccess {
      expression: Variable {
       identifier: "config",
       position: (6, 9),
      },
      attribute_path: AttributePath {
       parts: [
        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: [
     Binding {
      from: AttributePath {
       parts: [
        Raw {
         content: "port",
         position: (9, 3),
        },
       ],
      },
      to: Int {
       value: 9876,
       position: (9, 10),
      },
     },
     Binding {
      from: AttributePath {
       parts: [
        Raw {
         content: "extraOpts",
         position: (10, 3),
        },
       ],
      },
      to: Map {
       bindings: [
        Binding {
         from: AttributePath {
          parts: [
           Raw {
            content: "tokenPath",
            position: (11, 5),
           },
          ],
         },
         to: FunctionApplication {
          function: Variable {
           identifier: "mkOption",
           position: (11, 17),
          },
          arguments: [
           Map {
            bindings: [
             Binding {
              from: AttributePath {
               parts: [
                Raw {
                 content: "type",
                 position: (12, 7),
                },
               ],
              },
              to: FunctionApplication {
               function: PropertyAccess {
                expression: Variable {
                 identifier: "types",
                 position: (12, 14),
                },
                attribute_path: AttributePath {
                 parts: [
                  Raw {
                   content: "nullOr",
                   position: (12, 20),
                  },
                 ],
                },
                default: None,
               },
               arguments: [
                PropertyAccess {
                 expression: Variable {
                  identifier: "types",
                  position: (12, 27),
                 },
                 attribute_path: AttributePath {
                  parts: [
                   Raw {
                    content: "path",
                    position: (12, 33),
                   },
                  ],
                 },
                 default: None,
                },
               ],
              },
             },
             Binding {
              from: AttributePath {
               parts: [
                Raw {
                 content: "apply",
                 position: (13, 7),
                },
               ],
              },
              to: Function {
               argument: Simple {
                identifier: "final",
               },
               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),
              },
             },
             Binding {
              from: AttributePath {
               parts: [
                Raw {
                 content: "description",
                 position: (14, 7),
                },
               ],
              },
              to: 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),
                },
               ],
               position: (14, 21),
              },
             },
            ],
            recursive: false,
            position: (11, 26),
           },
          ],
         },
        },
        Binding {
         from: AttributePath {
          parts: [
           Raw {
            content: "interval",
            position: (21, 5),
           },
          ],
         },
         to: FunctionApplication {
          function: Variable {
           identifier: "mkOption",
           position: (21, 16),
          },
          arguments: [
           Map {
            bindings: [
             Binding {
              from: AttributePath {
               parts: [
                Raw {
                 content: "type",
                 position: (22, 7),
                },
               ],
              },
              to: PropertyAccess {
               expression: Variable {
                identifier: "types",
                position: (22, 14),
               },
               attribute_path: AttributePath {
                parts: [
                 Raw {
                  content: "str",
                  position: (22, 20),
                 },
                ],
               },
               default: None,
              },
             },
             Binding {
              from: AttributePath {
               parts: [
                Raw {
                 content: "default",
                 position: (23, 7),
                },
               ],
              },
              to: String {
               parts: [
                Raw {
                 content: "30s",
                 position: (23, 18),
                },
               ],
               position: (23, 17),
              },
             },
             Binding {
              from: AttributePath {
               parts: [
                Raw {
                 content: "example",
                 position: (24, 7),
                },
               ],
              },
              to: String {
               parts: [
                Raw {
                 content: "1min",
                 position: (24, 18),
                },
               ],
               position: (24, 17),
              },
             },
             Binding {
              from: AttributePath {
               parts: [
                Raw {
                 content: "description",
                 position: (25, 7),
                },
               ],
              },
              to: String {
               parts: [
                Raw {
                 content: "How often to update metrics.\n",
                 position: (26, 1),
                },
               ],
               position: (25, 21),
              },
             },
            ],
            recursive: false,
            position: (21, 25),
           },
          ],
         },
        },
        Binding {
         from: AttributePath {
          parts: [
           Raw {
            content: "endpoint",
            position: (29, 5),
           },
          ],
         },
         to: FunctionApplication {
          function: Variable {
           identifier: "mkOption",
           position: (29, 16),
          },
          arguments: [
           Map {
            bindings: [
             Binding {
              from: AttributePath {
               parts: [
                Raw {
                 content: "type",
                 position: (30, 7),
                },
               ],
              },
              to: PropertyAccess {
               expression: Variable {
                identifier: "types",
                position: (30, 14),
               },
               attribute_path: AttributePath {
                parts: [
                 Raw {
                  content: "str",
                  position: (30, 20),
                 },
                ],
               },
               default: None,
              },
             },
             Binding {
              from: AttributePath {
               parts: [
                Raw {
                 content: "default",
                 position: (31, 7),
                },
               ],
              },
              to: String {
               parts: [
                Raw {
                 content: "https://agent.buildkite.com/v3",
                 position: (31, 18),
                },
               ],
               position: (31, 17),
              },
             },
             Binding {
              from: AttributePath {
               parts: [
                Raw {
                 content: "description",
                 position: (32, 7),
                },
               ],
              },
              to: String {
               parts: [
                Raw {
                 content: "The Buildkite Agent API endpoint.\n",
                 position: (33, 1),
                },
               ],
               position: (32, 21),
              },
             },
            ],
            recursive: false,
            position: (29, 25),
           },
          ],
         },
        },
        Binding {
         from: AttributePath {
          parts: [
           Raw {
            content: "queues",
            position: (36, 5),
           },
          ],
         },
         to: FunctionApplication {
          function: Variable {
           identifier: "mkOption",
           position: (36, 14),
          },
          arguments: [
           Map {
            bindings: [
             Binding {
              from: AttributePath {
               parts: [
                Raw {
                 content: "type",
                 position: (37, 7),
                },
               ],
              },
              to: With {
               expression: Variable {
                identifier: "types",
                position: (37, 19),
               },
               target: FunctionApplication {
                function: Variable {
                 identifier: "nullOr",
                 position: (37, 26),
                },
                arguments: [
                 Parentheses {
                  expression: FunctionApplication {
                   function: Variable {
                    identifier: "listOf",
                    position: (37, 34),
                   },
                   arguments: [
                    Variable {
                     identifier: "str",
                     position: (37, 41),
                    },
                   ],
                  },
                  position: (37, 33),
                 },
                ],
               },
               position: (37, 14),
              },
             },
             Binding {
              from: AttributePath {
               parts: [
                Raw {
                 content: "default",
                 position: (38, 7),
                },
               ],
              },
              to: Variable {
               identifier: "null",
               position: (38, 17),
              },
             },
             Binding {
              from: AttributePath {
               parts: [
                Raw {
                 content: "example",
                 position: (39, 7),
                },
               ],
              },
              to: FunctionApplication {
               function: Variable {
                identifier: "literalExpression",
                position: (39, 17),
               },
               arguments: [
                String {
                 parts: [
                  Raw {
                   content: "[ \"my-queue1\" \"my-queue2\" ]",
                   position: (39, 37),
                  },
                 ],
                 position: (39, 35),
                },
               ],
              },
             },
             Binding {
              from: AttributePath {
               parts: [
                Raw {
                 content: "description",
                 position: (40, 7),
                },
               ],
              },
              to: String {
               parts: [
                Raw {
                 content: "Which specific queues to process.\n",
                 position: (41, 1),
                },
               ],
               position: (40, 21),
              },
             },
            ],
            recursive: false,
            position: (36, 23),
           },
          ],
         },
        },
       ],
       recursive: false,
       position: (10, 15),
      },
     },
     Binding {
      from: AttributePath {
       parts: [
        Raw {
         content: "serviceOpts",
         position: (45, 3),
        },
       ],
      },
      to: Map {
       bindings: [
        Binding {
         from: AttributePath {
          parts: [
           Raw {
            content: "script",
            position: (46, 5),
           },
          ],
         },
         to: LetIn {
          bindings: [
           Binding {
            from: AttributePath {
             parts: [
              Raw {
               content: "queues",
               position: (48, 9),
              },
             ],
            },
            to: FunctionApplication {
             function: Variable {
              identifier: "concatStringsSep",
              position: (48, 18),
             },
             arguments: [
              String {
               parts: [
                Raw {
                 content: " ",
                 position: (48, 36),
                },
               ],
               position: (48, 35),
              },
              Parentheses {
               expression: FunctionApplication {
                function: Variable {
                 identifier: "map",
                 position: (48, 40),
                },
                arguments: [
                 Parentheses {
                  expression: Function {
                   argument: Simple {
                    identifier: "q",
                   },
                   definition: String {
                    parts: [
                     Raw {
                      content: "-queue ",
                      position: (48, 49),
                     },
                     Interpolation {
                      expression: Variable {
                       identifier: "q",
                       position: (48, 58),
                      },
                     },
                    ],
                    position: (48, 48),
                   },
                   position: (48, 45),
                  },
                  position: (48, 44),
                 },
                 PropertyAccess {
                  expression: Variable {
                   identifier: "cfg",
                   position: (48, 63),
                  },
                  attribute_path: AttributePath {
                   parts: [
                    Raw {
                     content: "queues",
                     position: (48, 67),
                    },
                   ],
                  },
                  default: None,
                 },
                ],
               },
               position: (48, 39),
              },
             ],
            },
           },
          ],
          target: String {
           parts: [
            Raw {
             content: "export BUILDKITE_AGENT_TOKEN=\"$(cat ",
             position: (51, 1),
            },
            Interpolation {
             expression: FunctionApplication {
              function: Variable {
               identifier: "toString",
               position: (51, 47),
              },
              arguments: [
               PropertyAccess {
                expression: Variable {
                 identifier: "cfg",
                 position: (51, 56),
                },
                attribute_path: AttributePath {
                 parts: [
                  Raw {
                   content: "tokenPath",
                   position: (51, 60),
                  },
                 ],
                },
                default: None,
               },
              ],
             },
            },
            Raw {
             content: ")\"\nexec ",
             position: (51, 70),
            },
            Interpolation {
             expression: PropertyAccess {
              expression: Variable {
               identifier: "pkgs",
               position: (52, 16),
              },
              attribute_path: AttributePath {
               parts: [
                Raw {
                 content: "buildkite-agent-metrics",
                 position: (52, 21),
                },
               ],
              },
              default: None,
             },
            },
            Raw {
             content: "/bin/buildkite-agent-metrics \\\n  -backend prometheus \\\n  -interval ",
             position: (52, 45),
            },
            Interpolation {
             expression: PropertyAccess {
              expression: Variable {
               identifier: "cfg",
               position: (54, 23),
              },
              attribute_path: AttributePath {
               parts: [
                Raw {
                 content: "interval",
                 position: (54, 27),
                },
               ],
              },
              default: None,
             },
            },
            Raw {
             content: " \\\n  -endpoint ",
             position: (54, 36),
            },
            Interpolation {
             expression: PropertyAccess {
              expression: Variable {
               identifier: "cfg",
               position: (55, 23),
              },
              attribute_path: AttributePath {
               parts: [
                Raw {
                 content: "endpoint",
                 position: (55, 27),
                },
               ],
              },
              default: None,
             },
            },
            Raw {
             content: " \\\n  ",
             position: (55, 36),
            },
            Interpolation {
             expression: FunctionApplication {
              function: Variable {
               identifier: "optionalString",
               position: (56, 13),
              },
              arguments: [
               Parentheses {
                expression: BinaryOperation {
                 operator: NotEqualTo,
                 operands: [
                  PropertyAccess {
                   expression: Variable {
                    identifier: "cfg",
                    position: (56, 29),
                   },
                   attribute_path: AttributePath {
                    parts: [
                     Raw {
                      content: "queues",
                      position: (56, 33),
                     },
                    ],
                   },
                   default: None,
                  },
                  Variable {
                   identifier: "null",
                   position: (56, 43),
                  },
                 ],
                 position: (56, 40),
                },
                position: (56, 28),
               },
               Variable {
                identifier: "queues",
                position: (56, 49),
               },
              ],
             },
            },
            Raw {
             content: " \\\n  -prometheus-addr \"",
             position: (56, 56),
            },
            Interpolation {
             expression: PropertyAccess {
              expression: Variable {
               identifier: "cfg",
               position: (57, 31),
              },
              attribute_path: AttributePath {
               parts: [
                Raw {
                 content: "listenAddress",
                 position: (57, 35),
                },
               ],
              },
              default: None,
             },
            },
            Raw {
             content: ":",
             position: (57, 49),
            },
            Interpolation {
             expression: FunctionApplication {
              function: Variable {
               identifier: "toString",
               position: (57, 52),
              },
              arguments: [
               PropertyAccess {
                expression: Variable {
                 identifier: "cfg",
                 position: (57, 61),
                },
                attribute_path: AttributePath {
                 parts: [
                  Raw {
                   content: "port",
                   position: (57, 65),
                  },
                 ],
                },
                default: None,
               },
              ],
             },
            },
            Raw {
             content: "\" ",
             position: (57, 70),
            },
            Interpolation {
             expression: FunctionApplication {
              function: Variable {
               identifier: "concatStringsSep",
               position: (57, 74),
              },
              arguments: [
               String {
                parts: [
                 Raw {
                  content: " ",
                  position: (57, 92),
                 },
                ],
                position: (57, 91),
               },
               PropertyAccess {
                expression: Variable {
                 identifier: "cfg",
                 position: (57, 95),
                },
                attribute_path: AttributePath {
                 parts: [
                  Raw {
                   content: "extraFlags",
                   position: (57, 99),
                  },
                 ],
                },
                default: None,
               },
              ],
             },
            },
            Raw {
             content: "\n",
             position: (57, 110),
            },
           ],
           position: (50, 7),
          },
          position: (47, 7),
         },
        },
        Binding {
         from: AttributePath {
          parts: [
           Raw {
            content: "serviceConfig",
            position: (59, 5),
           },
          ],
         },
         to: Map {
          bindings: [
           Binding {
            from: AttributePath {
             parts: [
              Raw {
               content: "DynamicUser",
               position: (60, 7),
              },
             ],
            },
            to: Variable {
             identifier: "false",
             position: (60, 21),
            },
           },
           Binding {
            from: AttributePath {
             parts: [
              Raw {
               content: "RuntimeDirectory",
               position: (61, 7),
              },
             ],
            },
            to: String {
             parts: [
              Raw {
               content: "buildkite-agent-metrics",
               position: (61, 27),
              },
             ],
             position: (61, 26),
            },
           },
          ],
          recursive: false,
          position: (59, 21),
         },
        },
       ],
       recursive: false,
       position: (45, 17),
      },
     },
    ],
    recursive: false,
    position: (8, 1),
   },
   position: (5, 1),
  },
  position: (3, 1),
 },
 position: (1, 1),
}