---
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: "rspamd",
         position: (6, 46),
        },
       ],
      },
      default: None,
     },
    },
    Binding {
     from: AttributePath {
      parts: [
       Raw {
        content: "mkFile",
        position: (8, 3),
       },
      ],
     },
     to: Function {
      argument: Simple {
       identifier: "conf",
      },
      definition: FunctionApplication {
       function: PropertyAccess {
        expression: Variable {
         identifier: "pkgs",
         position: (9, 5),
        },
        attribute_path: AttributePath {
         parts: [
          Raw {
           content: "writeText",
           position: (9, 10),
          },
         ],
        },
        default: None,
       },
       arguments: [
        String {
         parts: [
          Raw {
           content: "rspamd-exporter-config.yml",
           position: (9, 21),
          },
         ],
         position: (9, 20),
        },
        Parentheses {
         expression: FunctionApplication {
          function: PropertyAccess {
           expression: Variable {
            identifier: "builtins",
            position: (9, 50),
           },
           attribute_path: AttributePath {
            parts: [
             Raw {
              content: "toJSON",
              position: (9, 59),
             },
            ],
           },
           default: None,
          },
          arguments: [
           Variable {
            identifier: "conf",
            position: (9, 66),
           },
          ],
         },
         position: (9, 49),
        },
       ],
      },
      position: (8, 12),
     },
    },
    Binding {
     from: AttributePath {
      parts: [
       Raw {
        content: "generateConfig",
        position: (11, 3),
       },
      ],
     },
     to: Function {
      argument: Simple {
       identifier: "extraLabels",
      },
      definition: Map {
       bindings: [
        Binding {
         from: AttributePath {
          parts: [
           Raw {
            content: "metrics",
            position: (12, 5),
           },
          ],
         },
         to: BinaryOperation {
          operator: Concatenation,
          operands: [
           Parentheses {
            expression: FunctionApplication {
             function: Variable {
              identifier: "map",
              position: (12, 16),
             },
             arguments: [
              Parentheses {
               expression: Function {
                argument: Simple {
                 identifier: "path",
                },
                definition: Map {
                 bindings: [
                  Binding {
                   from: AttributePath {
                    parts: [
                     Raw {
                      content: "name",
                      position: (13, 7),
                     },
                    ],
                   },
                   to: String {
                    parts: [
                     Raw {
                      content: "rspamd_",
                      position: (13, 15),
                     },
                     Interpolation {
                      expression: FunctionApplication {
                       function: Variable {
                        identifier: "replaceStrings",
                        position: (13, 24),
                       },
                       arguments: [
                        List {
                         elements: [
                          String {
                           parts: [
                            Raw {
                             content: "[",
                             position: (13, 42),
                            },
                           ],
                           position: (13, 41),
                          },
                          String {
                           parts: [
                            Raw {
                             content: ".",
                             position: (13, 46),
                            },
                           ],
                           position: (13, 45),
                          },
                          String {
                           parts: [
                            Raw {
                             content: " ",
                             position: (13, 50),
                            },
                           ],
                           position: (13, 49),
                          },
                          String {
                           parts: [
                            Raw {
                             content: "]",
                             position: (13, 54),
                            },
                           ],
                           position: (13, 53),
                          },
                          String {
                           parts: [
                            Raw {
                             content: "\\",
                             position: (13, 58),
                            },
                           ],
                           position: (13, 57),
                          },
                          String {
                           parts: [
                            Raw {
                             content: "'",
                             position: (13, 63),
                            },
                           ],
                           position: (13, 62),
                          },
                         ],
                         position: (13, 39),
                        },
                        List {
                         elements: [
                          String {
                           parts: [
                            Raw {
                             content: "_",
                             position: (13, 71),
                            },
                           ],
                           position: (13, 70),
                          },
                          String {
                           parts: [
                            Raw {
                             content: "_",
                             position: (13, 75),
                            },
                           ],
                           position: (13, 74),
                          },
                          String {
                           parts: [
                            Raw {
                             content: "_",
                             position: (13, 79),
                            },
                           ],
                           position: (13, 78),
                          },
                          String {
                           parts: [],
                           position: (13, 82),
                          },
                          String {
                           parts: [],
                           position: (13, 85),
                          },
                          String {
                           parts: [],
                           position: (13, 88),
                          },
                         ],
                         position: (13, 68),
                        },
                        Variable {
                         identifier: "path",
                         position: (13, 93),
                        },
                       ],
                      },
                     },
                    ],
                    position: (13, 14),
                   },
                  },
                  Binding {
                   from: AttributePath {
                    parts: [
                     Raw {
                      content: "path",
                      position: (14, 7),
                     },
                    ],
                   },
                   to: String {
                    parts: [
                     Raw {
                      content: "{ .",
                      position: (14, 15),
                     },
                     Interpolation {
                      expression: Variable {
                       identifier: "path",
                       position: (14, 20),
                      },
                     },
                     Raw {
                      content: " }",
                      position: (14, 25),
                     },
                    ],
                    position: (14, 14),
                   },
                  },
                  Binding {
                   from: AttributePath {
                    parts: [
                     Raw {
                      content: "labels",
                      position: (15, 7),
                     },
                    ],
                   },
                   to: Variable {
                    identifier: "extraLabels",
                    position: (15, 16),
                   },
                  },
                 ],
                 recursive: false,
                 position: (12, 27),
                },
                position: (12, 21),
               },
               position: (12, 20),
              },
              List {
               elements: [
                String {
                 parts: [
                  Raw {
                   content: "actions['add\\ header']",
                   position: (17, 8),
                  },
                 ],
                 position: (17, 7),
                },
                String {
                 parts: [
                  Raw {
                   content: "actions['no\\ action']",
                   position: (18, 8),
                  },
                 ],
                 position: (18, 7),
                },
                String {
                 parts: [
                  Raw {
                   content: "actions['rewrite\\ subject']",
                   position: (19, 8),
                  },
                 ],
                 position: (19, 7),
                },
                String {
                 parts: [
                  Raw {
                   content: "actions['soft\\ reject']",
                   position: (20, 8),
                  },
                 ],
                 position: (20, 7),
                },
                String {
                 parts: [
                  Raw {
                   content: "actions.greylist",
                   position: (21, 8),
                  },
                 ],
                 position: (21, 7),
                },
                String {
                 parts: [
                  Raw {
                   content: "actions.reject",
                   position: (22, 8),
                  },
                 ],
                 position: (22, 7),
                },
                String {
                 parts: [
                  Raw {
                   content: "bytes_allocated",
                   position: (23, 8),
                  },
                 ],
                 position: (23, 7),
                },
                String {
                 parts: [
                  Raw {
                   content: "chunks_allocated",
                   position: (24, 8),
                  },
                 ],
                 position: (24, 7),
                },
                String {
                 parts: [
                  Raw {
                   content: "chunks_freed",
                   position: (25, 8),
                  },
                 ],
                 position: (25, 7),
                },
                String {
                 parts: [
                  Raw {
                   content: "chunks_oversized",
                   position: (26, 8),
                  },
                 ],
                 position: (26, 7),
                },
                String {
                 parts: [
                  Raw {
                   content: "connections",
                   position: (27, 8),
                  },
                 ],
                 position: (27, 7),
                },
                String {
                 parts: [
                  Raw {
                   content: "control_connections",
                   position: (28, 8),
                  },
                 ],
                 position: (28, 7),
                },
                String {
                 parts: [
                  Raw {
                   content: "ham_count",
                   position: (29, 8),
                  },
                 ],
                 position: (29, 7),
                },
                String {
                 parts: [
                  Raw {
                   content: "learned",
                   position: (30, 8),
                  },
                 ],
                 position: (30, 7),
                },
                String {
                 parts: [
                  Raw {
                   content: "pools_allocated",
                   position: (31, 8),
                  },
                 ],
                 position: (31, 7),
                },
                String {
                 parts: [
                  Raw {
                   content: "pools_freed",
                   position: (32, 8),
                  },
                 ],
                 position: (32, 7),
                },
                String {
                 parts: [
                  Raw {
                   content: "read_only",
                   position: (33, 8),
                  },
                 ],
                 position: (33, 7),
                },
                String {
                 parts: [
                  Raw {
                   content: "scanned",
                   position: (34, 8),
                  },
                 ],
                 position: (34, 7),
                },
                String {
                 parts: [
                  Raw {
                   content: "shared_chunks_allocated",
                   position: (35, 8),
                  },
                 ],
                 position: (35, 7),
                },
                String {
                 parts: [
                  Raw {
                   content: "spam_count",
                   position: (36, 8),
                  },
                 ],
                 position: (36, 7),
                },
                String {
                 parts: [
                  Raw {
                   content: "total_learns",
                   position: (37, 8),
                  },
                 ],
                 position: (37, 7),
                },
               ],
               position: (16, 8),
              },
             ],
            },
            position: (12, 15),
           },
           List {
            elements: [
             Map {
              bindings: [
               Binding {
                from: AttributePath {
                 parts: [
                  Raw {
                   content: "name",
                   position: (39, 7),
                  },
                 ],
                },
                to: String {
                 parts: [
                  Raw {
                   content: "rspamd_statfiles",
                   position: (39, 15),
                  },
                 ],
                 position: (39, 14),
                },
               },
               Binding {
                from: AttributePath {
                 parts: [
                  Raw {
                   content: "type",
                   position: (40, 7),
                  },
                 ],
                },
                to: String {
                 parts: [
                  Raw {
                   content: "object",
                   position: (40, 15),
                  },
                 ],
                 position: (40, 14),
                },
               },
               Binding {
                from: AttributePath {
                 parts: [
                  Raw {
                   content: "path",
                   position: (41, 7),
                  },
                 ],
                },
                to: String {
                 parts: [
                  Raw {
                   content: "{.statfiles[*]}",
                   position: (41, 15),
                  },
                 ],
                 position: (41, 14),
                },
               },
               Binding {
                from: AttributePath {
                 parts: [
                  Raw {
                   content: "labels",
                   position: (42, 7),
                  },
                 ],
                },
                to: FunctionApplication {
                 function: Variable {
                  identifier: "recursiveUpdate",
                  position: (42, 16),
                 },
                 arguments: [
                  Map {
                   bindings: [
                    Binding {
                     from: AttributePath {
                      parts: [
                       Raw {
                        content: "symbol",
                        position: (43, 9),
                       },
                      ],
                     },
                     to: String {
                      parts: [
                       Raw {
                        content: "{.symbol}",
                        position: (43, 19),
                       },
                      ],
                      position: (43, 18),
                     },
                    },
                    Binding {
                     from: AttributePath {
                      parts: [
                       Raw {
                        content: "type",
                        position: (44, 9),
                       },
                      ],
                     },
                     to: String {
                      parts: [
                       Raw {
                        content: "{.type}",
                        position: (44, 17),
                       },
                      ],
                      position: (44, 16),
                     },
                    },
                   ],
                   recursive: false,
                   position: (42, 32),
                  },
                  Variable {
                   identifier: "extraLabels",
                   position: (45, 9),
                  },
                 ],
                },
               },
               Binding {
                from: AttributePath {
                 parts: [
                  Raw {
                   content: "values",
                   position: (46, 7),
                  },
                 ],
                },
                to: Map {
                 bindings: [
                  Binding {
                   from: AttributePath {
                    parts: [
                     Raw {
                      content: "revision",
                      position: (47, 9),
                     },
                    ],
                   },
                   to: String {
                    parts: [
                     Raw {
                      content: "{.revision}",
                      position: (47, 21),
                     },
                    ],
                    position: (47, 20),
                   },
                  },
                  Binding {
                   from: AttributePath {
                    parts: [
                     Raw {
                      content: "size",
                      position: (48, 9),
                     },
                    ],
                   },
                   to: String {
                    parts: [
                     Raw {
                      content: "{.size}",
                      position: (48, 17),
                     },
                    ],
                    position: (48, 16),
                   },
                  },
                  Binding {
                   from: AttributePath {
                    parts: [
                     Raw {
                      content: "total",
                      position: (49, 9),
                     },
                    ],
                   },
                   to: String {
                    parts: [
                     Raw {
                      content: "{.total}",
                      position: (49, 18),
                     },
                    ],
                    position: (49, 17),
                   },
                  },
                  Binding {
                   from: AttributePath {
                    parts: [
                     Raw {
                      content: "used",
                      position: (50, 9),
                     },
                    ],
                   },
                   to: String {
                    parts: [
                     Raw {
                      content: "{.used}",
                      position: (50, 17),
                     },
                    ],
                    position: (50, 16),
                   },
                  },
                  Binding {
                   from: AttributePath {
                    parts: [
                     Raw {
                      content: "languages",
                      position: (51, 9),
                     },
                    ],
                   },
                   to: String {
                    parts: [
                     Raw {
                      content: "{.languages}",
                      position: (51, 22),
                     },
                    ],
                    position: (51, 21),
                   },
                  },
                  Binding {
                   from: AttributePath {
                    parts: [
                     Raw {
                      content: "users",
                      position: (52, 9),
                     },
                    ],
                   },
                   to: String {
                    parts: [
                     Raw {
                      content: "{.users}",
                      position: (52, 18),
                     },
                    ],
                    position: (52, 17),
                   },
                  },
                 ],
                 recursive: false,
                 position: (46, 16),
                },
               },
              ],
              recursive: false,
              position: (38, 12),
             },
            ],
            position: (38, 11),
           },
          ],
          position: (38, 8),
         },
        },
       ],
       recursive: false,
       position: (11, 33),
      },
      position: (11, 20),
     },
    },
   ],
   target: Map {
    bindings: [
     Binding {
      from: AttributePath {
       parts: [
        Raw {
         content: "port",
         position: (58, 3),
        },
       ],
      },
      to: Int {
       value: 7980,
       position: (58, 10),
      },
     },
     Binding {
      from: AttributePath {
       parts: [
        Raw {
         content: "extraOpts",
         position: (59, 3),
        },
       ],
      },
      to: Map {
       bindings: [
        Binding {
         from: AttributePath {
          parts: [
           Raw {
            content: "extraLabels",
            position: (60, 5),
           },
          ],
         },
         to: FunctionApplication {
          function: Variable {
           identifier: "mkOption",
           position: (60, 19),
          },
          arguments: [
           Map {
            bindings: [
             Binding {
              from: AttributePath {
               parts: [
                Raw {
                 content: "type",
                 position: (61, 7),
                },
               ],
              },
              to: FunctionApplication {
               function: PropertyAccess {
                expression: Variable {
                 identifier: "types",
                 position: (61, 14),
                },
                attribute_path: AttributePath {
                 parts: [
                  Raw {
                   content: "attrsOf",
                   position: (61, 20),
                  },
                 ],
                },
                default: None,
               },
               arguments: [
                PropertyAccess {
                 expression: Variable {
                  identifier: "types",
                  position: (61, 28),
                 },
                 attribute_path: AttributePath {
                  parts: [
                   Raw {
                    content: "str",
                    position: (61, 34),
                   },
                  ],
                 },
                 default: None,
                },
               ],
              },
             },
             Binding {
              from: AttributePath {
               parts: [
                Raw {
                 content: "default",
                 position: (62, 7),
                },
               ],
              },
              to: Map {
               bindings: [
                Binding {
                 from: AttributePath {
                  parts: [
                   Raw {
                    content: "host",
                    position: (63, 9),
                   },
                  ],
                 },
                 to: PropertyAccess {
                  expression: Variable {
                   identifier: "config",
                   position: (63, 16),
                  },
                  attribute_path: AttributePath {
                   parts: [
                    Raw {
                     content: "networking",
                     position: (63, 23),
                    },
                    Raw {
                     content: "hostName",
                     position: (63, 34),
                    },
                   ],
                  },
                  default: None,
                 },
                },
               ],
               recursive: false,
               position: (62, 17),
              },
             },
             Binding {
              from: AttributePath {
               parts: [
                Raw {
                 content: "defaultText",
                 position: (65, 7),
                },
               ],
              },
              to: FunctionApplication {
               function: Variable {
                identifier: "literalExpression",
                position: (65, 21),
               },
               arguments: [
                String {
                 parts: [
                  Raw {
                   content: "{ host = config.networking.hostName; }",
                   position: (65, 40),
                  },
                 ],
                 position: (65, 39),
                },
               ],
              },
             },
             Binding {
              from: AttributePath {
               parts: [
                Raw {
                 content: "example",
                 position: (66, 7),
                },
               ],
              },
              to: FunctionApplication {
               function: Variable {
                identifier: "literalExpression",
                position: (66, 17),
               },
               arguments: [
                String {
                 parts: [
                  Raw {
                   content: "{\n  host = config.networking.hostName;\n  custom_label = \"some_value\";\n}\n",
                   position: (67, 1),
                  },
                 ],
                 position: (66, 35),
                },
               ],
              },
             },
             Binding {
              from: AttributePath {
               parts: [
                Raw {
                 content: "description",
                 position: (72, 7),
                },
               ],
              },
              to: String {
               parts: [
                Raw {
                 content: "Set of labels added to each metric.",
                 position: (72, 22),
                },
               ],
               position: (72, 21),
              },
             },
            ],
            recursive: false,
            position: (60, 28),
           },
          ],
         },
        },
       ],
       recursive: false,
       position: (59, 15),
      },
     },
     Binding {
      from: AttributePath {
       parts: [
        Raw {
         content: "serviceOpts",
         position: (75, 3),
        },
        Raw {
         content: "serviceConfig",
         position: (75, 15),
        },
        Raw {
         content: "ExecStart",
         position: (75, 29),
        },
       ],
      },
      to: String {
       parts: [
        Raw {
         content: "",
         position: (76, 1),
        },
        Interpolation {
         expression: PropertyAccess {
          expression: Variable {
           identifier: "pkgs",
           position: (76, 7),
          },
          attribute_path: AttributePath {
           parts: [
            Raw {
             content: "prometheus-json-exporter",
             position: (76, 12),
            },
           ],
          },
          default: None,
         },
        },
        Raw {
         content: "/bin/json_exporter \\\n  --config.file ",
         position: (76, 37),
        },
        Interpolation {
         expression: FunctionApplication {
          function: Variable {
           identifier: "mkFile",
           position: (77, 23),
          },
          arguments: [
           Parentheses {
            expression: FunctionApplication {
             function: Variable {
              identifier: "generateConfig",
              position: (77, 31),
             },
             arguments: [
              PropertyAccess {
               expression: Variable {
                identifier: "cfg",
                position: (77, 46),
               },
               attribute_path: AttributePath {
                parts: [
                 Raw {
                  content: "extraLabels",
                  position: (77, 50),
                 },
                ],
               },
               default: None,
              },
             ],
            },
            position: (77, 30),
           },
          ],
         },
        },
        Raw {
         content: " \\\n  --web.listen-address \"",
         position: (77, 63),
        },
        Interpolation {
         expression: PropertyAccess {
          expression: Variable {
           identifier: "cfg",
           position: (78, 31),
          },
          attribute_path: AttributePath {
           parts: [
            Raw {
             content: "listenAddress",
             position: (78, 35),
            },
           ],
          },
          default: None,
         },
        },
        Raw {
         content: ":",
         position: (78, 49),
        },
        Interpolation {
         expression: FunctionApplication {
          function: Variable {
           identifier: "toString",
           position: (78, 52),
          },
          arguments: [
           PropertyAccess {
            expression: Variable {
             identifier: "cfg",
             position: (78, 61),
            },
            attribute_path: AttributePath {
             parts: [
              Raw {
               content: "port",
               position: (78, 65),
              },
             ],
            },
            default: None,
           },
          ],
         },
        },
        Raw {
         content: "\" \\\n  ",
         position: (78, 70),
        },
        Interpolation {
         expression: FunctionApplication {
          function: Variable {
           identifier: "concatStringsSep",
           position: (79, 9),
          },
          arguments: [
           String {
            parts: [
             Raw {
              content: " \\\n  ",
              position: (79, 27),
             },
            ],
            position: (79, 26),
           },
           PropertyAccess {
            expression: Variable {
             identifier: "cfg",
             position: (79, 36),
            },
            attribute_path: AttributePath {
             parts: [
              Raw {
               content: "extraFlags",
               position: (79, 40),
              },
             ],
            },
            default: None,
           },
          ],
         },
        },
        Raw {
         content: "\n",
         position: (79, 51),
        },
       ],
       position: (75, 41),
      },
     },
     Binding {
      from: AttributePath {
       parts: [
        Raw {
         content: "imports",
         position: (82, 3),
        },
       ],
      },
      to: List {
       elements: [
        Parentheses {
         expression: FunctionApplication {
          function: Variable {
           identifier: "mkRemovedOptionModule",
           position: (83, 6),
          },
          arguments: [
           List {
            elements: [
             String {
              parts: [
               Raw {
                content: "url",
                position: (83, 31),
               },
              ],
              position: (83, 30),
             },
            ],
            position: (83, 28),
           },
           String {
            parts: [
             Raw {
              content: "This option was removed. The URL of the rspamd metrics endpoint\nmust now be provided to the exporter by prometheus via the url\nparameter `target'.\n\nIn prometheus a scrape URL would look like this:\n\n  http://some.rspamd-exporter.host:7980/probe?target=http://some.rspamd.host:11334/stat\n\nFor more information, take a look at the official documentation\n(https://github.com/prometheus-community/json_exporter) of the json_exporter.\n",
              position: (84, 1),
             },
            ],
            position: (83, 38),
           },
          ],
         },
         position: (83, 5),
        },
        Parentheses {
         expression: Map {
          bindings: [
           Binding {
            from: AttributePath {
             parts: [
              Raw {
               content: "options",
               position: (95, 9),
              },
              Raw {
               content: "warnings",
               position: (95, 17),
              },
             ],
            },
            to: PropertyAccess {
             expression: Variable {
              identifier: "options",
              position: (95, 28),
             },
             attribute_path: AttributePath {
              parts: [
               Raw {
                content: "warnings",
                position: (95, 36),
               },
              ],
             },
             default: None,
            },
           },
           Binding {
            from: AttributePath {
             parts: [
              Raw {
               content: "options",
               position: (95, 46),
              },
              Raw {
               content: "assertions",
               position: (95, 54),
              },
             ],
            },
            to: PropertyAccess {
             expression: Variable {
              identifier: "options",
              position: (95, 67),
             },
             attribute_path: AttributePath {
              parts: [
               Raw {
                content: "assertions",
                position: (95, 75),
               },
              ],
             },
             default: None,
            },
           },
          ],
          recursive: false,
          position: (95, 7),
         },
         position: (95, 6),
        },
       ],
       position: (82, 13),
      },
     },
    ],
    recursive: false,
    position: (57, 1),
   },
   position: (5, 1),
  },
  position: (3, 1),
 },
 position: (1, 1),
}