---
Function {
 argument: None,
 arguments: FunctionArguments {
  arguments: [
   FunctionArgument {
    identifier: "pkgs",
    default: None,
   },
   FunctionArgument {
    identifier: "lib",
    default: None,
   },
   FunctionArgument {
    identifier: "config",
    default: None,
   },
  ],
  ellipsis: true,
 },
 definition: With {
  expression: Variable {
   identifier: "lib",
   position: (3, 6),
  },
  target: LetIn {
   bindings: [
    KeyValue(
     AttributePath {
      attributes: [
       Raw {
        content: "cfg",
        position: (5, 3),
       },
      ],
     },
     PropertyAccess {
      expression: Variable {
       identifier: "config",
       position: (5, 9),
      },
      attribute_path: AttributePath {
       attributes: [
        Raw {
         content: "services",
         position: (5, 16),
        },
        Raw {
         content: "corosync",
         position: (5, 25),
        },
       ],
      },
      default: None,
     },
    ),
   ],
   target: Map {
    bindings: [
     KeyValue(
      AttributePath {
       attributes: [
        Raw {
         content: "options",
         position: (9, 3),
        },
        Raw {
         content: "services",
         position: (9, 11),
        },
        Raw {
         content: "corosync",
         position: (9, 20),
        },
       ],
      },
      Map {
       bindings: [
        KeyValue(
         AttributePath {
          attributes: [
           Raw {
            content: "enable",
            position: (10, 5),
           },
          ],
         },
         FunctionApplication {
          function: Variable {
           identifier: "mkEnableOption",
           position: (10, 14),
          },
          arguments: [
           String {
            parts: [
             Raw {
              content: "corosync",
             },
            ],
            position: (10, 29),
           },
          ],
         },
        ),
        KeyValue(
         AttributePath {
          attributes: [
           Raw {
            content: "package",
            position: (12, 5),
           },
          ],
         },
         FunctionApplication {
          function: Variable {
           identifier: "mkOption",
           position: (12, 15),
          },
          arguments: [
           Map {
            bindings: [
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "type",
                 position: (13, 7),
                },
               ],
              },
              PropertyAccess {
               expression: Variable {
                identifier: "types",
                position: (13, 14),
               },
               attribute_path: AttributePath {
                attributes: [
                 Raw {
                  content: "package",
                  position: (13, 20),
                 },
                ],
               },
               default: None,
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "default",
                 position: (14, 7),
                },
               ],
              },
              PropertyAccess {
               expression: Variable {
                identifier: "pkgs",
                position: (14, 17),
               },
               attribute_path: AttributePath {
                attributes: [
                 Raw {
                  content: "corosync",
                  position: (14, 22),
                 },
                ],
               },
               default: None,
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "defaultText",
                 position: (15, 7),
                },
               ],
              },
              FunctionApplication {
               function: Variable {
                identifier: "literalExpression",
                position: (15, 21),
               },
               arguments: [
                String {
                 parts: [
                  Raw {
                   content: "pkgs.corosync",
                  },
                 ],
                 position: (15, 39),
                },
               ],
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "description",
                 position: (16, 7),
                },
               ],
              },
              String {
               parts: [
                Raw {
                 content: "Package that should be used for corosync.",
                },
               ],
               position: (16, 21),
              },
             ),
            ],
            recursive: false,
            position: (12, 24),
           },
          ],
         },
        ),
        KeyValue(
         AttributePath {
          attributes: [
           Raw {
            content: "clusterName",
            position: (19, 5),
           },
          ],
         },
         FunctionApplication {
          function: Variable {
           identifier: "mkOption",
           position: (19, 19),
          },
          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: "str",
                  position: (20, 20),
                 },
                ],
               },
               default: None,
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "default",
                 position: (21, 7),
                },
               ],
              },
              String {
               parts: [
                Raw {
                 content: "nixcluster",
                },
               ],
               position: (21, 17),
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "description",
                 position: (22, 7),
                },
               ],
              },
              String {
               parts: [
                Raw {
                 content: "Name of the corosync cluster.",
                },
               ],
               position: (22, 21),
              },
             ),
            ],
            recursive: false,
            position: (19, 28),
           },
          ],
         },
        ),
        KeyValue(
         AttributePath {
          attributes: [
           Raw {
            content: "extraOptions",
            position: (25, 5),
           },
          ],
         },
         FunctionApplication {
          function: Variable {
           identifier: "mkOption",
           position: (25, 20),
          },
          arguments: [
           Map {
            bindings: [
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "type",
                 position: (26, 7),
                },
               ],
              },
              With {
               expression: Variable {
                identifier: "types",
                position: (26, 19),
               },
               target: FunctionApplication {
                function: Variable {
                 identifier: "listOf",
                 position: (26, 26),
                },
                arguments: [
                 Variable {
                  identifier: "str",
                  position: (26, 33),
                 },
                ],
               },
               position: (26, 14),
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "default",
                 position: (27, 7),
                },
               ],
              },
              List {
               elements: [],
               position: (27, 17),
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "description",
                 position: (28, 7),
                },
               ],
              },
              String {
               parts: [
                Raw {
                 content: "Additional options with which to start corosync.",
                },
               ],
               position: (28, 21),
              },
             ),
            ],
            recursive: false,
            position: (25, 29),
           },
          ],
         },
        ),
        KeyValue(
         AttributePath {
          attributes: [
           Raw {
            content: "nodelist",
            position: (31, 5),
           },
          ],
         },
         FunctionApplication {
          function: Variable {
           identifier: "mkOption",
           position: (31, 16),
          },
          arguments: [
           Map {
            bindings: [
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "description",
                 position: (32, 7),
                },
               ],
              },
              String {
               parts: [
                Raw {
                 content: "Corosync nodelist: all cluster members.",
                },
               ],
               position: (32, 21),
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "default",
                 position: (33, 7),
                },
               ],
              },
              List {
               elements: [],
               position: (33, 17),
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "type",
                 position: (34, 7),
                },
               ],
              },
              With {
               expression: Variable {
                identifier: "types",
                position: (34, 19),
               },
               target: FunctionApplication {
                function: Variable {
                 identifier: "listOf",
                 position: (34, 26),
                },
                arguments: [
                 FunctionApplication {
                  function: Variable {
                   identifier: "submodule",
                   position: (34, 34),
                  },
                  arguments: [
                   Map {
                    bindings: [
                     KeyValue(
                      AttributePath {
                       attributes: [
                        Raw {
                         content: "options",
                         position: (35, 9),
                        },
                       ],
                      },
                      Map {
                       bindings: [
                        KeyValue(
                         AttributePath {
                          attributes: [
                           Raw {
                            content: "nodeid",
                            position: (36, 11),
                           },
                          ],
                         },
                         FunctionApplication {
                          function: Variable {
                           identifier: "mkOption",
                           position: (36, 20),
                          },
                          arguments: [
                           Map {
                            bindings: [
                             KeyValue(
                              AttributePath {
                               attributes: [
                                Raw {
                                 content: "type",
                                 position: (37, 13),
                                },
                               ],
                              },
                              Variable {
                               identifier: "int",
                               position: (37, 20),
                              },
                             ),
                             KeyValue(
                              AttributePath {
                               attributes: [
                                Raw {
                                 content: "description",
                                 position: (38, 13),
                                },
                               ],
                              },
                              String {
                               parts: [
                                Raw {
                                 content: "Node ID number",
                                },
                               ],
                               position: (38, 27),
                              },
                             ),
                            ],
                            recursive: false,
                            position: (36, 29),
                           },
                          ],
                         },
                        ),
                        KeyValue(
                         AttributePath {
                          attributes: [
                           Raw {
                            content: "name",
                            position: (40, 11),
                           },
                          ],
                         },
                         FunctionApplication {
                          function: Variable {
                           identifier: "mkOption",
                           position: (40, 18),
                          },
                          arguments: [
                           Map {
                            bindings: [
                             KeyValue(
                              AttributePath {
                               attributes: [
                                Raw {
                                 content: "type",
                                 position: (41, 13),
                                },
                               ],
                              },
                              Variable {
                               identifier: "str",
                               position: (41, 20),
                              },
                             ),
                             KeyValue(
                              AttributePath {
                               attributes: [
                                Raw {
                                 content: "description",
                                 position: (42, 13),
                                },
                               ],
                              },
                              String {
                               parts: [
                                Raw {
                                 content: "Node name",
                                },
                               ],
                               position: (42, 27),
                              },
                             ),
                            ],
                            recursive: false,
                            position: (40, 27),
                           },
                          ],
                         },
                        ),
                        KeyValue(
                         AttributePath {
                          attributes: [
                           Raw {
                            content: "ring_addrs",
                            position: (44, 11),
                           },
                          ],
                         },
                         FunctionApplication {
                          function: Variable {
                           identifier: "mkOption",
                           position: (44, 24),
                          },
                          arguments: [
                           Map {
                            bindings: [
                             KeyValue(
                              AttributePath {
                               attributes: [
                                Raw {
                                 content: "type",
                                 position: (45, 13),
                                },
                               ],
                              },
                              FunctionApplication {
                               function: Variable {
                                identifier: "listOf",
                                position: (45, 20),
                               },
                               arguments: [
                                Variable {
                                 identifier: "str",
                                 position: (45, 27),
                                },
                               ],
                              },
                             ),
                             KeyValue(
                              AttributePath {
                               attributes: [
                                Raw {
                                 content: "description",
                                 position: (46, 13),
                                },
                               ],
                              },
                              String {
                               parts: [
                                Raw {
                                 content: "List of addresses, one for each ring.",
                                },
                               ],
                               position: (46, 27),
                              },
                             ),
                            ],
                            recursive: false,
                            position: (44, 33),
                           },
                          ],
                         },
                        ),
                       ],
                       recursive: false,
                       position: (35, 19),
                      },
                     ),
                    ],
                    recursive: false,
                    position: (34, 44),
                   },
                  ],
                 },
                ],
               },
               position: (34, 14),
              },
             ),
            ],
            recursive: false,
            position: (31, 25),
           },
          ],
         },
        ),
       ],
       recursive: false,
       position: (9, 31),
      },
     ),
     KeyValue(
      AttributePath {
       attributes: [
        Raw {
         content: "config",
         position: (54, 3),
        },
       ],
      },
      FunctionApplication {
       function: Variable {
        identifier: "mkIf",
        position: (54, 12),
       },
       arguments: [
        PropertyAccess {
         expression: Variable {
          identifier: "cfg",
          position: (54, 17),
         },
         attribute_path: AttributePath {
          attributes: [
           Raw {
            content: "enable",
            position: (54, 21),
           },
          ],
         },
         default: None,
        },
        Map {
         bindings: [
          KeyValue(
           AttributePath {
            attributes: [
             Raw {
              content: "environment",
              position: (55, 5),
             },
             Raw {
              content: "systemPackages",
              position: (55, 17),
             },
            ],
           },
           List {
            elements: [
             PropertyAccess {
              expression: Variable {
               identifier: "cfg",
               position: (55, 36),
              },
              attribute_path: AttributePath {
               attributes: [
                Raw {
                 content: "package",
                 position: (55, 40),
                },
               ],
              },
              default: None,
             },
            ],
            position: (55, 34),
           },
          ),
          KeyValue(
           AttributePath {
            attributes: [
             Raw {
              content: "environment",
              position: (57, 5),
             },
             Raw {
              content: "etc",
              position: (57, 17),
             },
             Expression {
              expression: __StringParts(
               [
                Raw {
                 content: "corosync/corosync.conf",
                },
               ],
              ),
             },
             Raw {
              content: "text",
              position: (57, 46),
             },
            ],
           },
           String {
            parts: [
             Raw {
              content: "totem {\n  version: 2\n  secauth: on\n  cluster_name: ",
             },
             Expression {
              expression: PropertyAccess {
               expression: Variable {
                identifier: "cfg",
                position: (61, 25),
               },
               attribute_path: AttributePath {
                attributes: [
                 Raw {
                  content: "clusterName",
                  position: (61, 29),
                 },
                ],
               },
               default: None,
              },
             },
             Raw {
              content: "\n  transport: knet\n}\n\nnodelist {\n  ",
             },
             Expression {
              expression: FunctionApplication {
               function: Variable {
                identifier: "concatMapStrings",
                position: (66, 11),
               },
               arguments: [
                Function {
                 argument: None,
                 arguments: FunctionArguments {
                  arguments: [
                   FunctionArgument {
                    identifier: "ring_addrs",
                    default: None,
                   },
                   FunctionArgument {
                    identifier: "name",
                    default: None,
                   },
                   FunctionArgument {
                    identifier: "nodeid",
                    default: None,
                   },
                  ],
                  ellipsis: false,
                 },
                 definition: String {
                  parts: [
                   Raw {
                    content: "node {\n  nodeid: ",
                   },
                   Expression {
                    expression: FunctionApplication {
                     function: Variable {
                      identifier: "toString",
                      position: (68, 23),
                     },
                     arguments: [
                      Variable {
                       identifier: "nodeid",
                       position: (68, 32),
                      },
                     ],
                    },
                   },
                   Raw {
                    content: "\n  name: ",
                   },
                   Expression {
                    expression: Variable {
                     identifier: "name",
                     position: (69, 21),
                    },
                   },
                   Raw {
                    content: "\n  ",
                   },
                   Expression {
                    expression: FunctionApplication {
                     function: Variable {
                      identifier: "concatStrings",
                      position: (70, 15),
                     },
                     arguments: [
                      FunctionApplication {
                       function: Variable {
                        identifier: "imap0",
                        position: (70, 30),
                       },
                       arguments: [
                        Function {
                         argument: Some(
                          "i",
                         ),
                         arguments: FunctionArguments {
                          arguments: [],
                          ellipsis: false,
                         },
                         definition: Function {
                          argument: Some(
                           "addr",
                          ),
                          arguments: FunctionArguments {
                           arguments: [],
                           ellipsis: false,
                          },
                          definition: String {
                           parts: [
                            Raw {
                             content: "ring",
                            },
                            Expression {
                             expression: FunctionApplication {
                              function: Variable {
                               identifier: "toString",
                               position: (71, 21),
                              },
                              arguments: [
                               Variable {
                                identifier: "i",
                                position: (71, 30),
                               },
                              ],
                             },
                            },
                            Raw {
                             content: "_addr: ",
                            },
                            Expression {
                             expression: Variable {
                              identifier: "addr",
                              position: (71, 41),
                             },
                            },
                            Raw {
                             content: "\n",
                            },
                           ],
                           position: (70, 46),
                          },
                          position: (70, 40),
                         },
                         position: (70, 37),
                        },
                        Variable {
                         identifier: "ring_addrs",
                         position: (72, 17),
                        },
                       ],
                      },
                     ],
                    },
                   },
                   Raw {
                    content: "\n}\n",
                   },
                  ],
                  position: (66, 59),
                 },
                 position: (66, 29),
                },
                PropertyAccess {
                 expression: Variable {
                  identifier: "cfg",
                  position: (74, 13),
                 },
                 attribute_path: AttributePath {
                  attributes: [
                   Raw {
                    content: "nodelist",
                    position: (74, 17),
                   },
                  ],
                 },
                 default: None,
                },
               ],
              },
             },
             Raw {
              content: "\n}\n\nquorum {\n  # only corosync_votequorum is supported\n  provider: corosync_votequorum\n  wait_for_all: 0\n  ",
             },
             Expression {
              expression: FunctionApplication {
               function: Variable {
                identifier: "optionalString",
                position: (81, 11),
               },
               arguments: [
                BinaryOperation {
                 operator: LessThan,
                 operands: [
                  FunctionApplication {
                   function: PropertyAccess {
                    expression: Variable {
                     identifier: "builtins",
                     position: (81, 27),
                    },
                    attribute_path: AttributePath {
                     attributes: [
                      Raw {
                       content: "length",
                       position: (81, 36),
                      },
                     ],
                    },
                    default: None,
                   },
                   arguments: [
                    PropertyAccess {
                     expression: Variable {
                      identifier: "cfg",
                      position: (81, 43),
                     },
                     attribute_path: AttributePath {
                      attributes: [
                       Raw {
                        content: "nodelist",
                        position: (81, 47),
                       },
                      ],
                     },
                     default: None,
                    },
                   ],
                  },
                  Int {
                   value: 3,
                   position: (81, 58),
                  },
                 ],
                 position: (81, 56),
                },
                String {
                 parts: [
                  Raw {
                   content: "two_node: 1\n",
                  },
                 ],
                 position: (81, 61),
                },
               ],
              },
             },
             Raw {
              content: "\n}\n\nlogging {\n  to_syslog: yes\n}\n",
             },
            ],
            position: (57, 53),
           },
          ),
          KeyValue(
           AttributePath {
            attributes: [
             Raw {
              content: "environment",
              position: (91, 5),
             },
             Raw {
              content: "etc",
              position: (91, 17),
             },
             Expression {
              expression: __StringParts(
               [
                Raw {
                 content: "corosync/uidgid.d/root",
                },
               ],
              ),
             },
             Raw {
              content: "text",
              position: (91, 46),
             },
            ],
           },
           String {
            parts: [
             Raw {
              content: "# allow pacemaker connection by root\nuidgid {\n  uid: 0\n  gid: 0\n}\n",
             },
            ],
            position: (91, 53),
           },
          ),
          KeyValue(
           AttributePath {
            attributes: [
             Raw {
              content: "systemd",
              position: (99, 5),
             },
             Raw {
              content: "packages",
              position: (99, 13),
             },
            ],
           },
           List {
            elements: [
             PropertyAccess {
              expression: Variable {
               identifier: "cfg",
               position: (99, 26),
              },
              attribute_path: AttributePath {
               attributes: [
                Raw {
                 content: "package",
                 position: (99, 30),
                },
               ],
              },
              default: None,
             },
            ],
            position: (99, 24),
           },
          ),
          KeyValue(
           AttributePath {
            attributes: [
             Raw {
              content: "systemd",
              position: (100, 5),
             },
             Raw {
              content: "services",
              position: (100, 13),
             },
             Raw {
              content: "corosync",
              position: (100, 22),
             },
            ],
           },
           Map {
            bindings: [
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "wantedBy",
                 position: (101, 7),
                },
               ],
              },
              List {
               elements: [
                String {
                 parts: [
                  Raw {
                   content: "multi-user.target",
                  },
                 ],
                 position: (101, 20),
                },
               ],
               position: (101, 18),
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "serviceConfig",
                 position: (102, 7),
                },
               ],
              },
              Map {
               bindings: [
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "StateDirectory",
                    position: (103, 9),
                   },
                  ],
                 },
                 String {
                  parts: [
                   Raw {
                    content: "corosync",
                   },
                  ],
                  position: (103, 26),
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "StateDirectoryMode",
                    position: (104, 9),
                   },
                  ],
                 },
                 String {
                  parts: [
                   Raw {
                    content: "0700",
                   },
                  ],
                  position: (104, 30),
                 },
                ),
               ],
               recursive: false,
               position: (102, 23),
              },
             ),
            ],
            recursive: false,
            position: (100, 33),
           },
          ),
          KeyValue(
           AttributePath {
            attributes: [
             Raw {
              content: "environment",
              position: (108, 5),
             },
             Raw {
              content: "etc",
              position: (108, 17),
             },
             Expression {
              expression: __StringParts(
               [
                Raw {
                 content: "sysconfig/corosync",
                },
               ],
              ),
             },
             Raw {
              content: "text",
              position: (108, 42),
             },
            ],
           },
           FunctionApplication {
            function: PropertyAccess {
             expression: Variable {
              identifier: "lib",
              position: (108, 49),
             },
             attribute_path: AttributePath {
              attributes: [
               Raw {
                content: "optionalString",
                position: (108, 53),
               },
              ],
             },
             default: None,
            },
            arguments: [
             BinaryOperation {
              operator: NotEqualTo,
              operands: [
               PropertyAccess {
                expression: Variable {
                 identifier: "cfg",
                 position: (108, 69),
                },
                attribute_path: AttributePath {
                 attributes: [
                  Raw {
                   content: "extraOptions",
                   position: (108, 73),
                  },
                 ],
                },
                default: None,
               },
               List {
                elements: [],
                position: (108, 89),
               },
              ],
              position: (108, 86),
             },
             String {
              parts: [
               Raw {
                content: "COROSYNC_OPTIONS=\"",
               },
               Expression {
                expression: FunctionApplication {
                 function: PropertyAccess {
                  expression: Variable {
                   identifier: "lib",
                   position: (109, 27),
                  },
                  attribute_path: AttributePath {
                   attributes: [
                    Raw {
                     content: "escapeShellArgs",
                     position: (109, 31),
                    },
                   ],
                  },
                  default: None,
                 },
                 arguments: [
                  PropertyAccess {
                   expression: Variable {
                    identifier: "cfg",
                    position: (109, 47),
                   },
                   attribute_path: AttributePath {
                    attributes: [
                     Raw {
                      content: "extraOptions",
                      position: (109, 51),
                     },
                    ],
                   },
                   default: None,
                  },
                 ],
                },
               },
               Raw {
                content: "\"\n",
               },
              ],
              position: (108, 93),
             },
            ],
           },
          ),
         ],
         recursive: false,
         position: (54, 28),
        },
       ],
      },
     ),
    ],
    recursive: false,
    position: (7, 1),
   },
   position: (4, 1),
  },
  position: (3, 1),
 },
 position: (1, 1),
}