---
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: "postgres",
         position: (6, 46),
        },
       ],
      },
      default: None,
     },
    ),
   ],
   target: Map {
    bindings: [
     KeyValue(
      AttributePath {
       attributes: [
        Raw {
         content: "port",
         position: (9, 3),
        },
       ],
      },
      Int {
       value: 9187,
       position: (9, 10),
      },
     ),
     KeyValue(
      AttributePath {
       attributes: [
        Raw {
         content: "extraOpts",
         position: (10, 3),
        },
       ],
      },
      Map {
       bindings: [
        KeyValue(
         AttributePath {
          attributes: [
           Raw {
            content: "telemetryPath",
            position: (11, 5),
           },
          ],
         },
         FunctionApplication {
          function: Variable {
           identifier: "mkOption",
           position: (11, 21),
          },
          arguments: [
           Map {
            bindings: [
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "type",
                 position: (12, 7),
                },
               ],
              },
              PropertyAccess {
               expression: Variable {
                identifier: "types",
                position: (12, 14),
               },
               attribute_path: AttributePath {
                attributes: [
                 Raw {
                  content: "str",
                  position: (12, 20),
                 },
                ],
               },
               default: None,
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "default",
                 position: (13, 7),
                },
               ],
              },
              String {
               parts: [
                Raw {
                 content: "/metrics",
                 position: (13, 18),
                },
               ],
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "description",
                 position: (14, 7),
                },
               ],
              },
              String {
               parts: [
                Raw {
                 content: "Path under which to expose metrics.\n",
                 position: (15, 1),
                },
               ],
              },
             ),
            ],
            recursive: false,
            position: (11, 30),
           },
          ],
         },
        ),
        KeyValue(
         AttributePath {
          attributes: [
           Raw {
            content: "dataSourceName",
            position: (18, 5),
           },
          ],
         },
         FunctionApplication {
          function: Variable {
           identifier: "mkOption",
           position: (18, 22),
          },
          arguments: [
           Map {
            bindings: [
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "type",
                 position: (19, 7),
                },
               ],
              },
              PropertyAccess {
               expression: Variable {
                identifier: "types",
                position: (19, 14),
               },
               attribute_path: AttributePath {
                attributes: [
                 Raw {
                  content: "str",
                  position: (19, 20),
                 },
                ],
               },
               default: None,
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "default",
                 position: (20, 7),
                },
               ],
              },
              String {
               parts: [
                Raw {
                 content: "user=postgres database=postgres host=/run/postgresql sslmode=disable",
                 position: (20, 18),
                },
               ],
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "example",
                 position: (21, 7),
                },
               ],
              },
              String {
               parts: [
                Raw {
                 content: "postgresql://username:password@localhost:5432/postgres?sslmode=disable",
                 position: (21, 18),
                },
               ],
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "description",
                 position: (22, 7),
                },
               ],
              },
              String {
               parts: [
                Raw {
                 content: "Accepts PostgreSQL URI form and key=value form arguments.\n",
                 position: (23, 1),
                },
               ],
              },
             ),
            ],
            recursive: false,
            position: (18, 31),
           },
          ],
         },
        ),
        KeyValue(
         AttributePath {
          attributes: [
           Raw {
            content: "runAsLocalSuperUser",
            position: (26, 5),
           },
          ],
         },
         FunctionApplication {
          function: Variable {
           identifier: "mkOption",
           position: (26, 27),
          },
          arguments: [
           Map {
            bindings: [
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "type",
                 position: (27, 7),
                },
               ],
              },
              PropertyAccess {
               expression: Variable {
                identifier: "types",
                position: (27, 14),
               },
               attribute_path: AttributePath {
                attributes: [
                 Raw {
                  content: "bool",
                  position: (27, 20),
                 },
                ],
               },
               default: None,
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "default",
                 position: (28, 7),
                },
               ],
              },
              Variable {
               identifier: "false",
               position: (28, 17),
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "description",
                 position: (29, 7),
                },
               ],
              },
              String {
               parts: [
                Raw {
                 content: "Whether to run the exporter as the local 'postgres' super user.\n",
                 position: (30, 1),
                },
               ],
              },
             ),
            ],
            recursive: false,
            position: (26, 36),
           },
          ],
         },
        ),
        KeyValue(
         AttributePath {
          attributes: [
           Raw {
            content: "environmentFile",
            position: (35, 5),
           },
          ],
         },
         FunctionApplication {
          function: Variable {
           identifier: "mkOption",
           position: (35, 23),
          },
          arguments: [
           Map {
            bindings: [
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "type",
                 position: (36, 7),
                },
               ],
              },
              FunctionApplication {
               function: PropertyAccess {
                expression: Variable {
                 identifier: "types",
                 position: (36, 14),
                },
                attribute_path: AttributePath {
                 attributes: [
                  Raw {
                   content: "nullOr",
                   position: (36, 20),
                  },
                 ],
                },
                default: None,
               },
               arguments: [
                PropertyAccess {
                 expression: Variable {
                  identifier: "types",
                  position: (36, 27),
                 },
                 attribute_path: AttributePath {
                  attributes: [
                   Raw {
                    content: "path",
                    position: (36, 33),
                   },
                  ],
                 },
                 default: None,
                },
               ],
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "default",
                 position: (37, 7),
                },
               ],
              },
              Variable {
               identifier: "null",
               position: (37, 17),
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "example",
                 position: (38, 7),
                },
               ],
              },
              String {
               parts: [
                Raw {
                 content: "/root/prometheus-postgres-exporter.env",
                 position: (38, 18),
                },
               ],
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "description",
                 position: (39, 7),
                },
               ],
              },
              String {
               parts: [
                Raw {
                 content: "Environment file as defined in <citerefentry>\n<refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum>\n</citerefentry>.\n\nSecrets may be passed to the service without adding them to the\nworld-readable Nix store, by specifying placeholder variables as\nthe option value in Nix and setting these variables accordingly in the\nenvironment file.\n\nEnvironment variables from this file will be interpolated into the\nconfig file using envsubst with this syntax:\n<literal>$ENVIRONMENT ",
                 position: (40, 1),
                },
                Raw {
                 content: "$",
                 position: (51, 31),
                },
                Raw {
                 content: "{VARIABLE}</literal>\n\nThe main use is to set the DATA_SOURCE_NAME that contains the\npostgres password\n\nnote that contents from this file will override dataSourceName\nif you have set it from nix.\n\n<programlisting>\n  # Content of the environment file\n  DATA_SOURCE_NAME=postgresql://username:password@localhost:5432/postgres?sslmode=disable\n</programlisting>\n\nNote that this file needs to be available on the host on which\nthis exporter is running.\n",
                 position: (51, 34),
                },
               ],
              },
             ),
            ],
            recursive: false,
            position: (35, 32),
           },
          ],
         },
        ),
       ],
       recursive: false,
       position: (10, 15),
      },
     ),
     KeyValue(
      AttributePath {
       attributes: [
        Raw {
         content: "serviceOpts",
         position: (70, 3),
        },
       ],
      },
      Map {
       bindings: [
        KeyValue(
         AttributePath {
          attributes: [
           Raw {
            content: "environment",
            position: (71, 5),
           },
           Raw {
            content: "DATA_SOURCE_NAME",
            position: (71, 17),
           },
          ],
         },
         PropertyAccess {
          expression: Variable {
           identifier: "cfg",
           position: (71, 36),
          },
          attribute_path: AttributePath {
           attributes: [
            Raw {
             content: "dataSourceName",
             position: (71, 40),
            },
           ],
          },
          default: None,
         },
        ),
        KeyValue(
         AttributePath {
          attributes: [
           Raw {
            content: "serviceConfig",
            position: (72, 5),
           },
          ],
         },
         Map {
          bindings: [
           KeyValue(
            AttributePath {
             attributes: [
              Raw {
               content: "DynamicUser",
               position: (73, 7),
              },
             ],
            },
            Variable {
             identifier: "false",
             position: (73, 21),
            },
           ),
           KeyValue(
            AttributePath {
             attributes: [
              Raw {
               content: "User",
               position: (74, 7),
              },
             ],
            },
            FunctionApplication {
             function: Variable {
              identifier: "mkIf",
              position: (74, 14),
             },
             arguments: [
              PropertyAccess {
               expression: Variable {
                identifier: "cfg",
                position: (74, 19),
               },
               attribute_path: AttributePath {
                attributes: [
                 Raw {
                  content: "runAsLocalSuperUser",
                  position: (74, 23),
                 },
                ],
               },
               default: None,
              },
              FunctionApplication {
               function: Variable {
                identifier: "mkForce",
                position: (74, 44),
               },
               arguments: [
                String {
                 parts: [
                  Raw {
                   content: "postgres",
                   position: (74, 53),
                  },
                 ],
                },
               ],
              },
             ],
            },
           ),
           KeyValue(
            AttributePath {
             attributes: [
              Raw {
               content: "EnvironmentFile",
               position: (75, 7),
              },
             ],
            },
            FunctionApplication {
             function: Variable {
              identifier: "mkIf",
              position: (75, 25),
             },
             arguments: [
              BinaryOperation {
               operator: NotEqualTo,
               operands: [
                PropertyAccess {
                 expression: Variable {
                  identifier: "cfg",
                  position: (75, 31),
                 },
                 attribute_path: AttributePath {
                  attributes: [
                   Raw {
                    content: "environmentFile",
                    position: (75, 35),
                   },
                  ],
                 },
                 default: None,
                },
                Variable {
                 identifier: "null",
                 position: (75, 54),
                },
               ],
               position: (75, 51),
              },
              List {
               elements: [
                PropertyAccess {
                 expression: Variable {
                  identifier: "cfg",
                  position: (75, 62),
                 },
                 attribute_path: AttributePath {
                  attributes: [
                   Raw {
                    content: "environmentFile",
                    position: (75, 66),
                   },
                  ],
                 },
                 default: None,
                },
               ],
               position: (75, 60),
              },
             ],
            },
           ),
           KeyValue(
            AttributePath {
             attributes: [
              Raw {
               content: "ExecStart",
               position: (76, 7),
              },
             ],
            },
            String {
             parts: [
              Raw {
               content: "",
               position: (77, 1),
              },
              Expression {
               expression: PropertyAccess {
                expression: Variable {
                 identifier: "pkgs",
                 position: (77, 11),
                },
                attribute_path: AttributePath {
                 attributes: [
                  Raw {
                   content: "prometheus-postgres-exporter",
                   position: (77, 16),
                  },
                 ],
                },
                default: None,
               },
              },
              Raw {
               content: "/bin/postgres_exporter \\\n  --web.listen-address ",
               position: (77, 45),
              },
              Expression {
               expression: PropertyAccess {
                expression: Variable {
                 identifier: "cfg",
                 position: (78, 34),
                },
                attribute_path: AttributePath {
                 attributes: [
                  Raw {
                   content: "listenAddress",
                   position: (78, 38),
                  },
                 ],
                },
                default: None,
               },
              },
              Raw {
               content: ":",
               position: (78, 52),
              },
              Expression {
               expression: FunctionApplication {
                function: Variable {
                 identifier: "toString",
                 position: (78, 55),
                },
                arguments: [
                 PropertyAccess {
                  expression: Variable {
                   identifier: "cfg",
                   position: (78, 64),
                  },
                  attribute_path: AttributePath {
                   attributes: [
                    Raw {
                     content: "port",
                     position: (78, 68),
                    },
                   ],
                  },
                  default: None,
                 },
                ],
               },
              },
              Raw {
               content: " \\\n  --web.telemetry-path ",
               position: (78, 73),
              },
              Expression {
               expression: PropertyAccess {
                expression: Variable {
                 identifier: "cfg",
                 position: (79, 34),
                },
                attribute_path: AttributePath {
                 attributes: [
                  Raw {
                   content: "telemetryPath",
                   position: (79, 38),
                  },
                 ],
                },
                default: None,
               },
              },
              Raw {
               content: " \\\n  ",
               position: (79, 52),
              },
              Expression {
               expression: FunctionApplication {
                function: Variable {
                 identifier: "concatStringsSep",
                 position: (80, 13),
                },
                arguments: [
                 String {
                  parts: [
                   Raw {
                    content: " \\\n  ",
                    position: (80, 31),
                   },
                  ],
                 },
                 PropertyAccess {
                  expression: Variable {
                   identifier: "cfg",
                   position: (80, 40),
                  },
                  attribute_path: AttributePath {
                   attributes: [
                    Raw {
                     content: "extraFlags",
                     position: (80, 44),
                    },
                   ],
                  },
                  default: None,
                 },
                ],
               },
              },
              Raw {
               content: "\n",
               position: (80, 55),
              },
             ],
            },
           ),
           KeyValue(
            AttributePath {
             attributes: [
              Raw {
               content: "RestrictAddressFamilies",
               position: (82, 7),
              },
             ],
            },
            List {
             elements: [
              String {
               parts: [
                Raw {
                 content: "AF_UNIX",
                 position: (84, 10),
                },
               ],
              },
             ],
             position: (82, 33),
            },
           ),
          ],
          recursive: false,
          position: (72, 21),
         },
        ),
       ],
       recursive: false,
       position: (70, 17),
      },
     ),
    ],
    recursive: false,
    position: (8, 1),
   },
   position: (5, 1),
  },
  position: (3, 1),
 },
 position: (1, 1),
}