---
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: "bitcoin",
         position: (6, 46),
        },
       ],
      },
      default: None,
     },
    ),
   ],
   target: Map {
    bindings: [
     KeyValue(
      AttributePath {
       attributes: [
        Raw {
         content: "port",
         position: (9, 3),
        },
       ],
      },
      Int {
       value: 9332,
       position: (9, 10),
      },
     ),
     KeyValue(
      AttributePath {
       attributes: [
        Raw {
         content: "extraOpts",
         position: (10, 3),
        },
       ],
      },
      Map {
       bindings: [
        KeyValue(
         AttributePath {
          attributes: [
           Raw {
            content: "rpcUser",
            position: (11, 5),
           },
          ],
         },
         FunctionApplication {
          function: Variable {
           identifier: "mkOption",
           position: (11, 15),
          },
          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: "bitcoinrpc",
                 position: (13, 18),
                },
               ],
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "description",
                 position: (14, 7),
                },
               ],
              },
              String {
               parts: [
                Raw {
                 content: "RPC user name.\n",
                 position: (15, 1),
                },
               ],
              },
             ),
            ],
            recursive: false,
            position: (11, 24),
           },
          ],
         },
        ),
        KeyValue(
         AttributePath {
          attributes: [
           Raw {
            content: "rpcPasswordFile",
            position: (19, 5),
           },
          ],
         },
         FunctionApplication {
          function: Variable {
           identifier: "mkOption",
           position: (19, 23),
          },
          arguments: [
           Map {
            bindings: [
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "type",
                 position: (20, 7),
                },
               ],
              },
              PropertyAccess {
               expression: Variable {
                identifier: "types",
                position: (20, 14),
               },
               attribute_path: AttributePath {
                attributes: [
                 Raw {
                  content: "path",
                  position: (20, 20),
                 },
                ],
               },
               default: None,
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "description",
                 position: (21, 7),
                },
               ],
              },
              String {
               parts: [
                Raw {
                 content: "File containing RPC password.\n",
                 position: (22, 1),
                },
               ],
              },
             ),
            ],
            recursive: false,
            position: (19, 32),
           },
          ],
         },
        ),
        KeyValue(
         AttributePath {
          attributes: [
           Raw {
            content: "rpcScheme",
            position: (26, 5),
           },
          ],
         },
         FunctionApplication {
          function: Variable {
           identifier: "mkOption",
           position: (26, 17),
          },
          arguments: [
           Map {
            bindings: [
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "type",
                 position: (27, 7),
                },
               ],
              },
              FunctionApplication {
               function: PropertyAccess {
                expression: Variable {
                 identifier: "types",
                 position: (27, 14),
                },
                attribute_path: AttributePath {
                 attributes: [
                  Raw {
                   content: "enum",
                   position: (27, 20),
                  },
                 ],
                },
                default: None,
               },
               arguments: [
                List {
                 elements: [
                  String {
                   parts: [
                    Raw {
                     content: "http",
                     position: (27, 28),
                    },
                   ],
                  },
                  String {
                   parts: [
                    Raw {
                     content: "https",
                     position: (27, 35),
                    },
                   ],
                  },
                 ],
                 position: (27, 25),
                },
               ],
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "default",
                 position: (28, 7),
                },
               ],
              },
              String {
               parts: [
                Raw {
                 content: "http",
                 position: (28, 18),
                },
               ],
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "description",
                 position: (29, 7),
                },
               ],
              },
              String {
               parts: [
                Raw {
                 content: "Whether to connect to bitcoind over http or https.\n",
                 position: (30, 1),
                },
               ],
              },
             ),
            ],
            recursive: false,
            position: (26, 26),
           },
          ],
         },
        ),
        KeyValue(
         AttributePath {
          attributes: [
           Raw {
            content: "rpcHost",
            position: (34, 5),
           },
          ],
         },
         FunctionApplication {
          function: Variable {
           identifier: "mkOption",
           position: (34, 15),
          },
          arguments: [
           Map {
            bindings: [
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "type",
                 position: (35, 7),
                },
               ],
              },
              PropertyAccess {
               expression: Variable {
                identifier: "types",
                position: (35, 14),
               },
               attribute_path: AttributePath {
                attributes: [
                 Raw {
                  content: "str",
                  position: (35, 20),
                 },
                ],
               },
               default: None,
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "default",
                 position: (36, 7),
                },
               ],
              },
              String {
               parts: [
                Raw {
                 content: "localhost",
                 position: (36, 18),
                },
               ],
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "description",
                 position: (37, 7),
                },
               ],
              },
              String {
               parts: [
                Raw {
                 content: "RPC host.\n",
                 position: (38, 1),
                },
               ],
              },
             ),
            ],
            recursive: false,
            position: (34, 24),
           },
          ],
         },
        ),
        KeyValue(
         AttributePath {
          attributes: [
           Raw {
            content: "rpcPort",
            position: (42, 5),
           },
          ],
         },
         FunctionApplication {
          function: Variable {
           identifier: "mkOption",
           position: (42, 15),
          },
          arguments: [
           Map {
            bindings: [
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "type",
                 position: (43, 7),
                },
               ],
              },
              PropertyAccess {
               expression: Variable {
                identifier: "types",
                position: (43, 14),
               },
               attribute_path: AttributePath {
                attributes: [
                 Raw {
                  content: "port",
                  position: (43, 20),
                 },
                ],
               },
               default: None,
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "default",
                 position: (44, 7),
                },
               ],
              },
              Int {
               value: 8332,
               position: (44, 17),
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "description",
                 position: (45, 7),
                },
               ],
              },
              String {
               parts: [
                Raw {
                 content: "RPC port number.\n",
                 position: (46, 1),
                },
               ],
              },
             ),
            ],
            recursive: false,
            position: (42, 24),
           },
          ],
         },
        ),
        KeyValue(
         AttributePath {
          attributes: [
           Raw {
            content: "refreshSeconds",
            position: (50, 5),
           },
          ],
         },
         FunctionApplication {
          function: Variable {
           identifier: "mkOption",
           position: (50, 22),
          },
          arguments: [
           Map {
            bindings: [
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "type",
                 position: (51, 7),
                },
               ],
              },
              PropertyAccess {
               expression: Variable {
                identifier: "types",
                position: (51, 14),
               },
               attribute_path: AttributePath {
                attributes: [
                 Raw {
                  content: "ints",
                  position: (51, 20),
                 },
                 Raw {
                  content: "unsigned",
                  position: (51, 25),
                 },
                ],
               },
               default: None,
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "default",
                 position: (52, 7),
                },
               ],
              },
              Int {
               value: 300,
               position: (52, 17),
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "description",
                 position: (53, 7),
                },
               ],
              },
              String {
               parts: [
                Raw {
                 content: "How often to ask bitcoind for metrics.\n",
                 position: (54, 1),
                },
               ],
              },
             ),
            ],
            recursive: false,
            position: (50, 31),
           },
          ],
         },
        ),
        KeyValue(
         AttributePath {
          attributes: [
           Raw {
            content: "extraEnv",
            position: (58, 5),
           },
          ],
         },
         FunctionApplication {
          function: Variable {
           identifier: "mkOption",
           position: (58, 16),
          },
          arguments: [
           Map {
            bindings: [
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "type",
                 position: (59, 7),
                },
               ],
              },
              FunctionApplication {
               function: PropertyAccess {
                expression: Variable {
                 identifier: "types",
                 position: (59, 14),
                },
                attribute_path: AttributePath {
                 attributes: [
                  Raw {
                   content: "attrsOf",
                   position: (59, 20),
                  },
                 ],
                },
                default: None,
               },
               arguments: [
                PropertyAccess {
                 expression: Variable {
                  identifier: "types",
                  position: (59, 28),
                 },
                 attribute_path: AttributePath {
                  attributes: [
                   Raw {
                    content: "str",
                    position: (59, 34),
                   },
                  ],
                 },
                 default: None,
                },
               ],
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "default",
                 position: (60, 7),
                },
               ],
              },
              Map {
               bindings: [],
               recursive: false,
               position: (60, 17),
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "description",
                 position: (61, 7),
                },
               ],
              },
              String {
               parts: [
                Raw {
                 content: "Extra environment variables for the exporter.\n",
                 position: (62, 1),
                },
               ],
              },
             ),
            ],
            recursive: false,
            position: (58, 25),
           },
          ],
         },
        ),
       ],
       recursive: false,
       position: (10, 15),
      },
     ),
     KeyValue(
      AttributePath {
       attributes: [
        Raw {
         content: "serviceOpts",
         position: (66, 3),
        },
       ],
      },
      Map {
       bindings: [
        KeyValue(
         AttributePath {
          attributes: [
           Raw {
            content: "script",
            position: (67, 5),
           },
          ],
         },
         String {
          parts: [
           Raw {
            content: "export BITCOIN_RPC_PASSWORD=$(cat ",
            position: (68, 1),
           },
           Expression {
            expression: PropertyAccess {
             expression: Variable {
              identifier: "cfg",
              position: (68, 43),
             },
             attribute_path: AttributePath {
              attributes: [
               Raw {
                content: "rpcPasswordFile",
                position: (68, 47),
               },
              ],
             },
             default: None,
            },
           },
           Raw {
            content: ")\nexec ",
            position: (68, 63),
           },
           Expression {
            expression: PropertyAccess {
             expression: Variable {
              identifier: "pkgs",
              position: (69, 14),
             },
             attribute_path: AttributePath {
              attributes: [
               Raw {
                content: "prometheus-bitcoin-exporter",
                position: (69, 19),
               },
              ],
             },
             default: None,
            },
           },
           Raw {
            content: "/bin/bitcoind-monitor.py\n",
            position: (69, 47),
           },
          ],
         },
        ),
        KeyValue(
         AttributePath {
          attributes: [
           Raw {
            content: "environment",
            position: (72, 5),
           },
          ],
         },
         BinaryOperation {
          operator: Update,
          operands: [
           Map {
            bindings: [
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "BITCOIN_RPC_USER",
                 position: (73, 7),
                },
               ],
              },
              PropertyAccess {
               expression: Variable {
                identifier: "cfg",
                position: (73, 26),
               },
               attribute_path: AttributePath {
                attributes: [
                 Raw {
                  content: "rpcUser",
                  position: (73, 30),
                 },
                ],
               },
               default: None,
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "BITCOIN_RPC_SCHEME",
                 position: (74, 7),
                },
               ],
              },
              PropertyAccess {
               expression: Variable {
                identifier: "cfg",
                position: (74, 28),
               },
               attribute_path: AttributePath {
                attributes: [
                 Raw {
                  content: "rpcScheme",
                  position: (74, 32),
                 },
                ],
               },
               default: None,
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "BITCOIN_RPC_HOST",
                 position: (75, 7),
                },
               ],
              },
              PropertyAccess {
               expression: Variable {
                identifier: "cfg",
                position: (75, 26),
               },
               attribute_path: AttributePath {
                attributes: [
                 Raw {
                  content: "rpcHost",
                  position: (75, 30),
                 },
                ],
               },
               default: None,
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "BITCOIN_RPC_PORT",
                 position: (76, 7),
                },
               ],
              },
              FunctionApplication {
               function: Variable {
                identifier: "toString",
                position: (76, 26),
               },
               arguments: [
                PropertyAccess {
                 expression: Variable {
                  identifier: "cfg",
                  position: (76, 35),
                 },
                 attribute_path: AttributePath {
                  attributes: [
                   Raw {
                    content: "rpcPort",
                    position: (76, 39),
                   },
                  ],
                 },
                 default: None,
                },
               ],
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "METRICS_ADDR",
                 position: (77, 7),
                },
               ],
              },
              PropertyAccess {
               expression: Variable {
                identifier: "cfg",
                position: (77, 22),
               },
               attribute_path: AttributePath {
                attributes: [
                 Raw {
                  content: "listenAddress",
                  position: (77, 26),
                 },
                ],
               },
               default: None,
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "METRICS_PORT",
                 position: (78, 7),
                },
               ],
              },
              FunctionApplication {
               function: Variable {
                identifier: "toString",
                position: (78, 22),
               },
               arguments: [
                PropertyAccess {
                 expression: Variable {
                  identifier: "cfg",
                  position: (78, 31),
                 },
                 attribute_path: AttributePath {
                  attributes: [
                   Raw {
                    content: "port",
                    position: (78, 35),
                   },
                  ],
                 },
                 default: None,
                },
               ],
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "REFRESH_SECONDS",
                 position: (79, 7),
                },
               ],
              },
              FunctionApplication {
               function: Variable {
                identifier: "toString",
                position: (79, 25),
               },
               arguments: [
                PropertyAccess {
                 expression: Variable {
                  identifier: "cfg",
                  position: (79, 34),
                 },
                 attribute_path: AttributePath {
                  attributes: [
                   Raw {
                    content: "refreshSeconds",
                    position: (79, 38),
                   },
                  ],
                 },
                 default: None,
                },
               ],
              },
             ),
            ],
            recursive: false,
            position: (72, 19),
           },
           PropertyAccess {
            expression: Variable {
             identifier: "cfg",
             position: (80, 10),
            },
            attribute_path: AttributePath {
             attributes: [
              Raw {
               content: "extraEnv",
               position: (80, 14),
              },
             ],
            },
            default: None,
           },
          ],
          position: (80, 7),
         },
        ),
       ],
       recursive: false,
       position: (66, 17),
      },
     ),
    ],
    recursive: false,
    position: (8, 1),
   },
   position: (5, 1),
  },
  position: (3, 1),
 },
 position: (1, 1),
}