---
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: (5, 5),
       },
      ],
     },
     PropertyAccess {
      expression: Variable {
       identifier: "config",
       position: (5, 11),
      },
      attribute_path: AttributePath {
       attributes: [
        Raw {
         content: "services",
         position: (5, 18),
        },
        Raw {
         content: "prometheus",
         position: (5, 27),
        },
        Raw {
         content: "exporters",
         position: (5, 38),
        },
        Raw {
         content: "fastly",
         position: (5, 48),
        },
       ],
      },
      default: None,
     },
    ),
   ],
   target: Map {
    bindings: [
     KeyValue(
      AttributePath {
       attributes: [
        Raw {
         content: "port",
         position: (8, 3),
        },
       ],
      },
      Int {
       value: 9118,
       position: (8, 10),
      },
     ),
     KeyValue(
      AttributePath {
       attributes: [
        Raw {
         content: "extraOpts",
         position: (9, 3),
        },
       ],
      },
      Map {
       bindings: [
        KeyValue(
         AttributePath {
          attributes: [
           Raw {
            content: "debug",
            position: (10, 5),
           },
          ],
         },
         FunctionApplication {
          function: Variable {
           identifier: "mkEnableOption",
           position: (10, 13),
          },
          arguments: [
           String {
            parts: [
             Raw {
              content: "Debug logging mode for fastly-exporter",
              position: (10, 29),
             },
            ],
           },
          ],
         },
        ),
        KeyValue(
         AttributePath {
          attributes: [
           Raw {
            content: "configFile",
            position: (12, 5),
           },
          ],
         },
         FunctionApplication {
          function: Variable {
           identifier: "mkOption",
           position: (12, 18),
          },
          arguments: [
           Map {
            bindings: [
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "type",
                 position: (13, 7),
                },
               ],
              },
              FunctionApplication {
               function: PropertyAccess {
                expression: Variable {
                 identifier: "types",
                 position: (13, 14),
                },
                attribute_path: AttributePath {
                 attributes: [
                  Raw {
                   content: "nullOr",
                   position: (13, 20),
                  },
                 ],
                },
                default: None,
               },
               arguments: [
                PropertyAccess {
                 expression: Variable {
                  identifier: "types",
                  position: (13, 27),
                 },
                 attribute_path: AttributePath {
                  attributes: [
                   Raw {
                    content: "path",
                    position: (13, 33),
                   },
                  ],
                 },
                 default: None,
                },
               ],
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "default",
                 position: (14, 7),
                },
               ],
              },
              Variable {
               identifier: "null",
               position: (14, 17),
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "description",
                 position: (15, 7),
                },
               ],
              },
              String {
               parts: [
                Raw {
                 content: "Path to a fastly-exporter configuration file.\nExample one can be generated with <literal>fastly-exporter --config-file-example</literal>.\n",
                 position: (16, 1),
                },
               ],
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "example",
                 position: (19, 7),
                },
               ],
              },
              String {
               parts: [
                Raw {
                 content: "./fastly-exporter-config.txt",
                 position: (19, 18),
                },
               ],
              },
             ),
            ],
            recursive: false,
            position: (12, 27),
           },
          ],
         },
        ),
        KeyValue(
         AttributePath {
          attributes: [
           Raw {
            content: "tokenPath",
            position: (22, 5),
           },
          ],
         },
         FunctionApplication {
          function: Variable {
           identifier: "mkOption",
           position: (22, 17),
          },
          arguments: [
           Map {
            bindings: [
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "type",
                 position: (23, 7),
                },
               ],
              },
              FunctionApplication {
               function: PropertyAccess {
                expression: Variable {
                 identifier: "types",
                 position: (23, 14),
                },
                attribute_path: AttributePath {
                 attributes: [
                  Raw {
                   content: "nullOr",
                   position: (23, 20),
                  },
                 ],
                },
                default: None,
               },
               arguments: [
                PropertyAccess {
                 expression: Variable {
                  identifier: "types",
                  position: (23, 27),
                 },
                 attribute_path: AttributePath {
                  attributes: [
                   Raw {
                    content: "path",
                    position: (23, 33),
                   },
                  ],
                 },
                 default: None,
                },
               ],
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "apply",
                 position: (24, 7),
                },
               ],
              },
              Function {
               argument: Some(
                "final",
               ),
               arguments: FunctionArguments {
                arguments: [],
                ellipsis: false,
               },
               definition: IfThenElse {
                predicate: BinaryOperation {
                 operator: EqualTo,
                 operands: [
                  Variable {
                   identifier: "final",
                   position: (24, 25),
                  },
                  Variable {
                   identifier: "null",
                   position: (24, 34),
                  },
                 ],
                 position: (24, 31),
                },
                then: Variable {
                 identifier: "null",
                 position: (24, 44),
                },
                else_: FunctionApplication {
                 function: Variable {
                  identifier: "toString",
                  position: (24, 54),
                 },
                 arguments: [
                  Variable {
                   identifier: "final",
                   position: (24, 63),
                  },
                 ],
                },
                position: (24, 22),
               },
               position: (24, 15),
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "description",
                 position: (25, 7),
                },
               ],
              },
              String {
               parts: [
                Raw {
                 content: "A run-time path to the token file, which is supposed to be provisioned\noutside of Nix store.\n",
                 position: (26, 1),
                },
               ],
              },
             ),
            ],
            recursive: false,
            position: (22, 26),
           },
          ],
         },
        ),
       ],
       recursive: false,
       position: (9, 15),
      },
     ),
     KeyValue(
      AttributePath {
       attributes: [
        Raw {
         content: "serviceOpts",
         position: (31, 3),
        },
       ],
      },
      Map {
       bindings: [
        KeyValue(
         AttributePath {
          attributes: [
           Raw {
            content: "script",
            position: (32, 5),
           },
          ],
         },
         String {
          parts: [
           Raw {
            content: "",
            position: (33, 1),
           },
           Expression {
            expression: FunctionApplication {
             function: Variable {
              identifier: "optionalString",
              position: (33, 9),
             },
             arguments: [
              BinaryOperation {
               operator: NotEqualTo,
               operands: [
                PropertyAccess {
                 expression: Variable {
                  identifier: "cfg",
                  position: (33, 25),
                 },
                 attribute_path: AttributePath {
                  attributes: [
                   Raw {
                    content: "tokenPath",
                    position: (33, 29),
                   },
                  ],
                 },
                 default: None,
                },
                Variable {
                 identifier: "null",
                 position: (33, 42),
                },
               ],
               position: (33, 39),
              },
              String {
               parts: [
                Raw {
                 content: "export FASTLY_API_TOKEN=$(cat ",
                 position: (34, 8),
                },
                Expression {
                 expression: FunctionApplication {
                  function: Variable {
                   identifier: "toString",
                   position: (34, 40),
                  },
                  arguments: [
                   PropertyAccess {
                    expression: Variable {
                     identifier: "cfg",
                     position: (34, 49),
                    },
                    attribute_path: AttributePath {
                     attributes: [
                      Raw {
                       content: "tokenPath",
                       position: (34, 53),
                      },
                     ],
                    },
                    default: None,
                   },
                  ],
                 },
                },
                Raw {
                 content: ")",
                 position: (34, 63),
                },
               ],
              },
             ],
            },
           },
           Raw {
            content: "\n",
            position: (34, 66),
           },
           Expression {
            expression: PropertyAccess {
             expression: Variable {
              identifier: "pkgs",
              position: (35, 9),
             },
             attribute_path: AttributePath {
              attributes: [
               Raw {
                content: "prometheus-fastly-exporter",
                position: (35, 14),
               },
              ],
             },
             default: None,
            },
           },
           Raw {
            content: "/bin/fastly-exporter \\\n  -listen http://",
            position: (35, 41),
           },
           Expression {
            expression: PropertyAccess {
             expression: Variable {
              identifier: "cfg",
              position: (36, 26),
             },
             attribute_path: AttributePath {
              attributes: [
               Raw {
                content: "listenAddress",
                position: (36, 30),
               },
              ],
             },
             default: None,
            },
           },
           Raw {
            content: ":",
            position: (36, 44),
           },
           Expression {
            expression: FunctionApplication {
             function: Variable {
              identifier: "toString",
              position: (36, 47),
             },
             arguments: [
              PropertyAccess {
               expression: Variable {
                identifier: "cfg",
                position: (36, 56),
               },
               attribute_path: AttributePath {
                attributes: [
                 Raw {
                  content: "port",
                  position: (36, 60),
                 },
                ],
               },
               default: None,
              },
             ],
            },
           },
           Raw {
            content: "\n  ",
            position: (36, 65),
           },
           Expression {
            expression: FunctionApplication {
             function: Variable {
              identifier: "optionalString",
              position: (37, 11),
             },
             arguments: [
              PropertyAccess {
               expression: Variable {
                identifier: "cfg",
                position: (37, 26),
               },
               attribute_path: AttributePath {
                attributes: [
                 Raw {
                  content: "debug",
                  position: (37, 30),
                 },
                ],
               },
               default: None,
              },
              String {
               parts: [
                Raw {
                 content: "-debug true",
                 position: (37, 37),
                },
               ],
              },
             ],
            },
           },
           Raw {
            content: " \\\n  ",
            position: (37, 50),
           },
           Expression {
            expression: FunctionApplication {
             function: Variable {
              identifier: "optionalString",
              position: (38, 11),
             },
             arguments: [
              BinaryOperation {
               operator: NotEqualTo,
               operands: [
                PropertyAccess {
                 expression: Variable {
                  identifier: "cfg",
                  position: (38, 27),
                 },
                 attribute_path: AttributePath {
                  attributes: [
                   Raw {
                    content: "configFile",
                    position: (38, 31),
                   },
                  ],
                 },
                 default: None,
                },
                Variable {
                 identifier: "null",
                 position: (38, 45),
                },
               ],
               position: (38, 42),
              },
              String {
               parts: [
                Raw {
                 content: "-config-file ",
                 position: (38, 52),
                },
                Expression {
                 expression: PropertyAccess {
                  expression: Variable {
                   identifier: "cfg",
                   position: (38, 67),
                  },
                  attribute_path: AttributePath {
                   attributes: [
                    Raw {
                     content: "configFile",
                     position: (38, 71),
                    },
                   ],
                  },
                  default: None,
                 },
                },
               ],
              },
             ],
            },
           },
           Raw {
            content: "\n",
            position: (38, 84),
           },
          ],
         },
        ),
       ],
       recursive: false,
       position: (31, 17),
      },
     ),
    ],
    recursive: false,
    position: (7, 1),
   },
   position: (5, 1),
  },
  position: (3, 1),
 },
 position: (1, 1),
}