---
Function {
 argument: None,
 arguments: FunctionArguments {
  arguments: [
   FunctionArgument {
    identifier: "lib",
    default: None,
   },
   FunctionArgument {
    identifier: "pkgs",
    default: None,
   },
   FunctionArgument {
    identifier: "config",
    default: None,
   },
  ],
  ellipsis: true,
 },
 definition: LetIn {
  bindings: [
   KeyValue(
    AttributePath {
     attributes: [
      Raw {
       content: "cfg",
       position: (2, 5),
      },
     ],
    },
    PropertyAccess {
     expression: Variable {
      identifier: "config",
      position: (2, 11),
     },
     attribute_path: AttributePath {
      attributes: [
       Raw {
        content: "services",
        position: (2, 18),
       },
       Raw {
        content: "victoriametrics",
        position: (2, 27),
       },
      ],
     },
     default: None,
    },
   ),
  ],
  target: Map {
   bindings: [
    KeyValue(
     AttributePath {
      attributes: [
       Raw {
        content: "options",
        position: (4, 3),
       },
       Raw {
        content: "services",
        position: (4, 11),
       },
       Raw {
        content: "victoriametrics",
        position: (4, 20),
       },
      ],
     },
     With {
      expression: Variable {
       identifier: "lib",
       position: (4, 43),
      },
      target: Map {
       bindings: [
        KeyValue(
         AttributePath {
          attributes: [
           Raw {
            content: "enable",
            position: (5, 5),
           },
          ],
         },
         FunctionApplication {
          function: Variable {
           identifier: "mkEnableOption",
           position: (5, 14),
          },
          arguments: [
           String {
            parts: [
             Raw {
              content: "victoriametrics",
              position: (5, 30),
             },
            ],
           },
          ],
         },
        ),
        KeyValue(
         AttributePath {
          attributes: [
           Raw {
            content: "package",
            position: (6, 5),
           },
          ],
         },
         FunctionApplication {
          function: Variable {
           identifier: "mkOption",
           position: (6, 15),
          },
          arguments: [
           Map {
            bindings: [
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "type",
                 position: (7, 7),
                },
               ],
              },
              PropertyAccess {
               expression: Variable {
                identifier: "types",
                position: (7, 14),
               },
               attribute_path: AttributePath {
                attributes: [
                 Raw {
                  content: "package",
                  position: (7, 20),
                 },
                ],
               },
               default: None,
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "default",
                 position: (8, 7),
                },
               ],
              },
              PropertyAccess {
               expression: Variable {
                identifier: "pkgs",
                position: (8, 17),
               },
               attribute_path: AttributePath {
                attributes: [
                 Raw {
                  content: "victoriametrics",
                  position: (8, 22),
                 },
                ],
               },
               default: None,
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "defaultText",
                 position: (9, 7),
                },
               ],
              },
              FunctionApplication {
               function: Variable {
                identifier: "literalExpression",
                position: (9, 21),
               },
               arguments: [
                String {
                 parts: [
                  Raw {
                   content: "pkgs.victoriametrics",
                   position: (9, 40),
                  },
                 ],
                },
               ],
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "description",
                 position: (10, 7),
                },
               ],
              },
              String {
               parts: [
                Raw {
                 content: "The VictoriaMetrics distribution to use.\n",
                 position: (11, 1),
                },
               ],
              },
             ),
            ],
            recursive: false,
            position: (6, 24),
           },
          ],
         },
        ),
        KeyValue(
         AttributePath {
          attributes: [
           Raw {
            content: "listenAddress",
            position: (14, 5),
           },
          ],
         },
         FunctionApplication {
          function: Variable {
           identifier: "mkOption",
           position: (14, 21),
          },
          arguments: [
           Map {
            bindings: [
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "default",
                 position: (15, 7),
                },
               ],
              },
              String {
               parts: [
                Raw {
                 content: ":8428",
                 position: (15, 18),
                },
               ],
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "type",
                 position: (16, 7),
                },
               ],
              },
              PropertyAccess {
               expression: Variable {
                identifier: "types",
                position: (16, 14),
               },
               attribute_path: AttributePath {
                attributes: [
                 Raw {
                  content: "str",
                  position: (16, 20),
                 },
                ],
               },
               default: None,
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "description",
                 position: (17, 7),
                },
               ],
              },
              String {
               parts: [
                Raw {
                 content: "The listen address for the http interface.\n",
                 position: (18, 1),
                },
               ],
              },
             ),
            ],
            recursive: false,
            position: (14, 30),
           },
          ],
         },
        ),
        KeyValue(
         AttributePath {
          attributes: [
           Raw {
            content: "retentionPeriod",
            position: (21, 5),
           },
          ],
         },
         FunctionApplication {
          function: Variable {
           identifier: "mkOption",
           position: (21, 23),
          },
          arguments: [
           Map {
            bindings: [
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "type",
                 position: (22, 7),
                },
               ],
              },
              PropertyAccess {
               expression: Variable {
                identifier: "types",
                position: (22, 14),
               },
               attribute_path: AttributePath {
                attributes: [
                 Raw {
                  content: "int",
                  position: (22, 20),
                 },
                ],
               },
               default: None,
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "default",
                 position: (23, 7),
                },
               ],
              },
              Int {
               value: 1,
               position: (23, 17),
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "description",
                 position: (24, 7),
                },
               ],
              },
              String {
               parts: [
                Raw {
                 content: "Retention period in months.\n",
                 position: (25, 1),
                },
               ],
              },
             ),
            ],
            recursive: false,
            position: (21, 32),
           },
          ],
         },
        ),
        KeyValue(
         AttributePath {
          attributes: [
           Raw {
            content: "extraOptions",
            position: (28, 5),
           },
          ],
         },
         FunctionApplication {
          function: Variable {
           identifier: "mkOption",
           position: (28, 20),
          },
          arguments: [
           Map {
            bindings: [
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "type",
                 position: (29, 7),
                },
               ],
              },
              FunctionApplication {
               function: PropertyAccess {
                expression: Variable {
                 identifier: "types",
                 position: (29, 14),
                },
                attribute_path: AttributePath {
                 attributes: [
                  Raw {
                   content: "listOf",
                   position: (29, 20),
                  },
                 ],
                },
                default: None,
               },
               arguments: [
                PropertyAccess {
                 expression: Variable {
                  identifier: "types",
                  position: (29, 27),
                 },
                 attribute_path: AttributePath {
                  attributes: [
                   Raw {
                    content: "str",
                    position: (29, 33),
                   },
                  ],
                 },
                 default: None,
                },
               ],
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "default",
                 position: (30, 7),
                },
               ],
              },
              List {
               elements: [],
               position: (30, 17),
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "description",
                 position: (31, 7),
                },
               ],
              },
              String {
               parts: [
                Raw {
                 content: "Extra options to pass to VictoriaMetrics. See the README: <link\nxlink:href=\"https://github.com/VictoriaMetrics/VictoriaMetrics/blob/master/README.md\" />\nor <command>victoriametrics -help</command> for more\ninformation.\n",
                 position: (32, 1),
                },
               ],
              },
             ),
            ],
            recursive: false,
            position: (28, 29),
           },
          ],
         },
        ),
       ],
       recursive: false,
       position: (4, 48),
      },
      position: (4, 38),
     },
    ),
    KeyValue(
     AttributePath {
      attributes: [
       Raw {
        content: "config",
        position: (39, 3),
       },
      ],
     },
     FunctionApplication {
      function: PropertyAccess {
       expression: Variable {
        identifier: "lib",
        position: (39, 12),
       },
       attribute_path: AttributePath {
        attributes: [
         Raw {
          content: "mkIf",
          position: (39, 16),
         },
        ],
       },
       default: None,
      },
      arguments: [
       PropertyAccess {
        expression: Variable {
         identifier: "cfg",
         position: (39, 21),
        },
        attribute_path: AttributePath {
         attributes: [
          Raw {
           content: "enable",
           position: (39, 25),
          },
         ],
        },
        default: None,
       },
       Map {
        bindings: [
         KeyValue(
          AttributePath {
           attributes: [
            Raw {
             content: "systemd",
             position: (40, 5),
            },
            Raw {
             content: "services",
             position: (40, 13),
            },
            Raw {
             content: "victoriametrics",
             position: (40, 22),
            },
           ],
          },
          Map {
           bindings: [
            KeyValue(
             AttributePath {
              attributes: [
               Raw {
                content: "description",
                position: (41, 7),
               },
              ],
             },
             String {
              parts: [
               Raw {
                content: "VictoriaMetrics time series database",
                position: (41, 22),
               },
              ],
             },
            ),
            KeyValue(
             AttributePath {
              attributes: [
               Raw {
                content: "after",
                position: (42, 7),
               },
              ],
             },
             List {
              elements: [
               String {
                parts: [
                 Raw {
                  content: "network.target",
                  position: (42, 18),
                 },
                ],
               },
              ],
              position: (42, 15),
             },
            ),
            KeyValue(
             AttributePath {
              attributes: [
               Raw {
                content: "startLimitBurst",
                position: (43, 7),
               },
              ],
             },
             Int {
              value: 5,
              position: (43, 25),
             },
            ),
            KeyValue(
             AttributePath {
              attributes: [
               Raw {
                content: "serviceConfig",
                position: (44, 7),
               },
              ],
             },
             Map {
              bindings: [
               KeyValue(
                AttributePath {
                 attributes: [
                  Raw {
                   content: "Restart",
                   position: (45, 9),
                  },
                 ],
                },
                String {
                 parts: [
                  Raw {
                   content: "on-failure",
                   position: (45, 20),
                  },
                 ],
                },
               ),
               KeyValue(
                AttributePath {
                 attributes: [
                  Raw {
                   content: "RestartSec",
                   position: (46, 9),
                  },
                 ],
                },
                Int {
                 value: 1,
                 position: (46, 22),
                },
               ),
               KeyValue(
                AttributePath {
                 attributes: [
                  Raw {
                   content: "StateDirectory",
                   position: (47, 9),
                  },
                 ],
                },
                String {
                 parts: [
                  Raw {
                   content: "victoriametrics",
                   position: (47, 27),
                  },
                 ],
                },
               ),
               KeyValue(
                AttributePath {
                 attributes: [
                  Raw {
                   content: "DynamicUser",
                   position: (48, 9),
                  },
                 ],
                },
                Variable {
                 identifier: "true",
                 position: (48, 23),
                },
               ),
               KeyValue(
                AttributePath {
                 attributes: [
                  Raw {
                   content: "ExecStart",
                   position: (49, 9),
                  },
                 ],
                },
                String {
                 parts: [
                  Raw {
                   content: "",
                   position: (50, 1),
                  },
                  Expression {
                   expression: PropertyAccess {
                    expression: Variable {
                     identifier: "cfg",
                     position: (50, 13),
                    },
                    attribute_path: AttributePath {
                     attributes: [
                      Raw {
                       content: "package",
                       position: (50, 17),
                      },
                     ],
                    },
                    default: None,
                   },
                  },
                  Raw {
                   content: "/bin/victoria-metrics \\\n    -storageDataPath=/var/lib/victoriametrics \\\n    -httpListenAddr ",
                   position: (50, 25),
                  },
                  Expression {
                   expression: PropertyAccess {
                    expression: Variable {
                     identifier: "cfg",
                     position: (52, 33),
                    },
                    attribute_path: AttributePath {
                     attributes: [
                      Raw {
                       content: "listenAddress",
                       position: (52, 37),
                      },
                     ],
                    },
                    default: None,
                   },
                  },
                  Raw {
                   content: " \\\n    -retentionPeriod ",
                   position: (52, 51),
                  },
                  Expression {
                   expression: FunctionApplication {
                    function: Variable {
                     identifier: "toString",
                     position: (53, 34),
                    },
                    arguments: [
                     PropertyAccess {
                      expression: Variable {
                       identifier: "cfg",
                       position: (53, 43),
                      },
                      attribute_path: AttributePath {
                       attributes: [
                        Raw {
                         content: "retentionPeriod",
                         position: (53, 47),
                        },
                       ],
                      },
                      default: None,
                     },
                    ],
                   },
                  },
                  Raw {
                   content: " \\\n    ",
                   position: (53, 63),
                  },
                  Expression {
                   expression: FunctionApplication {
                    function: PropertyAccess {
                     expression: Variable {
                      identifier: "lib",
                      position: (54, 17),
                     },
                     attribute_path: AttributePath {
                      attributes: [
                       Raw {
                        content: "escapeShellArgs",
                        position: (54, 21),
                       },
                      ],
                     },
                     default: None,
                    },
                    arguments: [
                     PropertyAccess {
                      expression: Variable {
                       identifier: "cfg",
                       position: (54, 37),
                      },
                      attribute_path: AttributePath {
                       attributes: [
                        Raw {
                         content: "extraOptions",
                         position: (54, 41),
                        },
                       ],
                      },
                      default: None,
                     },
                    ],
                   },
                  },
                  Raw {
                   content: "\n",
                   position: (54, 54),
                  },
                 ],
                },
               ),
               KeyValue(
                AttributePath {
                 attributes: [
                  Raw {
                   content: "LimitNOFILE",
                   position: (63, 9),
                  },
                 ],
                },
                Int {
                 value: 1048576,
                 position: (63, 23),
                },
               ),
              ],
              recursive: false,
              position: (44, 23),
             },
            ),
            KeyValue(
             AttributePath {
              attributes: [
               Raw {
                content: "wantedBy",
                position: (65, 7),
               },
              ],
             },
             List {
              elements: [
               String {
                parts: [
                 Raw {
                  content: "multi-user.target",
                  position: (65, 21),
                 },
                ],
               },
              ],
              position: (65, 18),
             },
            ),
            KeyValue(
             AttributePath {
              attributes: [
               Raw {
                content: "postStart",
                position: (67, 7),
               },
              ],
             },
             LetIn {
              bindings: [
               KeyValue(
                AttributePath {
                 attributes: [
                  Raw {
                   content: "bindAddr",
                   position: (69, 11),
                  },
                 ],
                },
                BinaryOperation {
                 operator: Addition,
                 operands: [
                  FunctionApplication {
                   function: PropertyAccess {
                    expression: Variable {
                     identifier: "lib",
                     position: (69, 23),
                    },
                    attribute_path: AttributePath {
                     attributes: [
                      Raw {
                       content: "optionalString",
                       position: (69, 27),
                      },
                     ],
                    },
                    default: None,
                   },
                   arguments: [
                    FunctionApplication {
                     function: PropertyAccess {
                      expression: Variable {
                       identifier: "lib",
                       position: (69, 43),
                      },
                      attribute_path: AttributePath {
                       attributes: [
                        Raw {
                         content: "hasPrefix",
                         position: (69, 47),
                        },
                       ],
                      },
                      default: None,
                     },
                     arguments: [
                      String {
                       parts: [
                        Raw {
                         content: ":",
                         position: (69, 58),
                        },
                       ],
                      },
                      PropertyAccess {
                       expression: Variable {
                        identifier: "cfg",
                        position: (69, 61),
                       },
                       attribute_path: AttributePath {
                        attributes: [
                         Raw {
                          content: "listenAddress",
                          position: (69, 65),
                         },
                        ],
                       },
                       default: None,
                      },
                     ],
                    },
                    String {
                     parts: [
                      Raw {
                       content: "127.0.0.1",
                       position: (69, 81),
                      },
                     ],
                    },
                   ],
                  },
                  PropertyAccess {
                   expression: Variable {
                    identifier: "cfg",
                    position: (69, 95),
                   },
                   attribute_path: AttributePath {
                    attributes: [
                     Raw {
                      content: "listenAddress",
                      position: (69, 99),
                     },
                    ],
                   },
                   default: None,
                  },
                 ],
                 position: (69, 93),
                },
               ),
              ],
              target: FunctionApplication {
               function: PropertyAccess {
                expression: Variable {
                 identifier: "lib",
                 position: (71, 9),
                },
                attribute_path: AttributePath {
                 attributes: [
                  Raw {
                   content: "mkBefore",
                   position: (71, 13),
                  },
                 ],
                },
                default: None,
               },
               arguments: [
                String {
                 parts: [
                  Raw {
                   content: "until ",
                   position: (72, 1),
                  },
                  Expression {
                   expression: FunctionApplication {
                    function: PropertyAccess {
                     expression: Variable {
                      identifier: "lib",
                      position: (72, 19),
                     },
                     attribute_path: AttributePath {
                      attributes: [
                       Raw {
                        content: "getBin",
                        position: (72, 23),
                       },
                      ],
                     },
                     default: None,
                    },
                    arguments: [
                     PropertyAccess {
                      expression: Variable {
                       identifier: "pkgs",
                       position: (72, 30),
                      },
                      attribute_path: AttributePath {
                       attributes: [
                        Raw {
                         content: "curl",
                         position: (72, 35),
                        },
                       ],
                      },
                      default: None,
                     },
                    ],
                   },
                  },
                  Raw {
                   content: "/bin/curl -s -o /dev/null http://",
                   position: (72, 40),
                  },
                  Expression {
                   expression: Variable {
                    identifier: "bindAddr",
                    position: (72, 75),
                   },
                  },
                  Raw {
                   content: "/ping; do\n  sleep 1;\ndone\n",
                   position: (72, 84),
                  },
                 ],
                },
               ],
              },
              position: (68, 9),
             },
            ),
           ],
           recursive: false,
           position: (40, 40),
          },
         ),
        ],
        recursive: false,
        position: (39, 32),
       },
      ],
     },
    ),
   ],
   recursive: false,
   position: (3, 1),
  },
  position: (2, 1),
 },
 position: (1, 1),
}