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