---
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: (6, 3),
       },
      ],
     },
     PropertyAccess {
      expression: Variable {
       identifier: "config",
       position: (6, 9),
      },
      attribute_path: AttributePath {
       attributes: [
        Raw {
         content: "services",
         position: (6, 16),
        },
        Raw {
         content: "journalbeat",
         position: (6, 25),
        },
       ],
      },
      default: None,
     },
    ),
    KeyValue(
     AttributePath {
      attributes: [
       Raw {
        content: "journalbeatYml",
        position: (8, 3),
       },
      ],
     },
     FunctionApplication {
      function: PropertyAccess {
       expression: Variable {
        identifier: "pkgs",
        position: (8, 20),
       },
       attribute_path: AttributePath {
        attributes: [
         Raw {
          content: "writeText",
          position: (8, 25),
         },
        ],
       },
       default: None,
      },
      arguments: [
       String {
        parts: [
         Raw {
          content: "journalbeat.yml",
          position: (8, 36),
         },
        ],
       },
       String {
        parts: [
         Raw {
          content: "name: ",
          position: (9, 1),
         },
         Expression {
          expression: PropertyAccess {
           expression: Variable {
            identifier: "cfg",
            position: (9, 13),
           },
           attribute_path: AttributePath {
            attributes: [
             Raw {
              content: "name",
              position: (9, 17),
             },
            ],
           },
           default: None,
          },
         },
         Raw {
          content: "\ntags: ",
          position: (9, 22),
         },
         Expression {
          expression: FunctionApplication {
           function: PropertyAccess {
            expression: Variable {
             identifier: "builtins",
             position: (10, 13),
            },
            attribute_path: AttributePath {
             attributes: [
              Raw {
               content: "toJSON",
               position: (10, 22),
              },
             ],
            },
            default: None,
           },
           arguments: [
            PropertyAccess {
             expression: Variable {
              identifier: "cfg",
              position: (10, 29),
             },
             attribute_path: AttributePath {
              attributes: [
               Raw {
                content: "tags",
                position: (10, 33),
               },
              ],
             },
             default: None,
            },
           ],
          },
         },
         Raw {
          content: "\n\n",
          position: (10, 38),
         },
         Expression {
          expression: PropertyAccess {
           expression: Variable {
            identifier: "cfg",
            position: (12, 7),
           },
           attribute_path: AttributePath {
            attributes: [
             Raw {
              content: "extraConfig",
              position: (12, 11),
             },
            ],
           },
           default: None,
          },
         },
         Raw {
          content: "\n",
          position: (12, 23),
         },
        ],
       },
      ],
     },
    ),
   ],
   target: Map {
    bindings: [
     KeyValue(
      AttributePath {
       attributes: [
        Raw {
         content: "options",
         position: (17, 3),
        },
       ],
      },
      Map {
       bindings: [
        KeyValue(
         AttributePath {
          attributes: [
           Raw {
            content: "services",
            position: (19, 5),
           },
           Raw {
            content: "journalbeat",
            position: (19, 14),
           },
          ],
         },
         Map {
          bindings: [
           KeyValue(
            AttributePath {
             attributes: [
              Raw {
               content: "enable",
               position: (21, 7),
              },
             ],
            },
            FunctionApplication {
             function: Variable {
              identifier: "mkEnableOption",
              position: (21, 16),
             },
             arguments: [
              String {
               parts: [
                Raw {
                 content: "journalbeat",
                 position: (21, 32),
                },
               ],
              },
             ],
            },
           ),
           KeyValue(
            AttributePath {
             attributes: [
              Raw {
               content: "package",
               position: (23, 7),
              },
             ],
            },
            FunctionApplication {
             function: Variable {
              identifier: "mkOption",
              position: (23, 17),
             },
             arguments: [
              Map {
               bindings: [
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "type",
                    position: (24, 9),
                   },
                  ],
                 },
                 PropertyAccess {
                  expression: Variable {
                   identifier: "types",
                   position: (24, 16),
                  },
                  attribute_path: AttributePath {
                   attributes: [
                    Raw {
                     content: "package",
                     position: (24, 22),
                    },
                   ],
                  },
                  default: None,
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "default",
                    position: (25, 9),
                   },
                  ],
                 },
                 PropertyAccess {
                  expression: Variable {
                   identifier: "pkgs",
                   position: (25, 19),
                  },
                  attribute_path: AttributePath {
                   attributes: [
                    Raw {
                     content: "journalbeat",
                     position: (25, 24),
                    },
                   ],
                  },
                  default: None,
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "defaultText",
                    position: (26, 9),
                   },
                  ],
                 },
                 FunctionApplication {
                  function: Variable {
                   identifier: "literalExpression",
                   position: (26, 23),
                  },
                  arguments: [
                   String {
                    parts: [
                     Raw {
                      content: "pkgs.journalbeat",
                      position: (26, 42),
                     },
                    ],
                   },
                  ],
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "description",
                    position: (27, 9),
                   },
                  ],
                 },
                 String {
                  parts: [
                   Raw {
                    content: "The journalbeat package to use\n",
                    position: (28, 1),
                   },
                  ],
                 },
                ),
               ],
               recursive: false,
               position: (23, 26),
              },
             ],
            },
           ),
           KeyValue(
            AttributePath {
             attributes: [
              Raw {
               content: "name",
               position: (32, 7),
              },
             ],
            },
            FunctionApplication {
             function: Variable {
              identifier: "mkOption",
              position: (32, 14),
             },
             arguments: [
              Map {
               bindings: [
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "type",
                    position: (33, 9),
                   },
                  ],
                 },
                 PropertyAccess {
                  expression: Variable {
                   identifier: "types",
                   position: (33, 16),
                  },
                  attribute_path: AttributePath {
                   attributes: [
                    Raw {
                     content: "str",
                     position: (33, 22),
                    },
                   ],
                  },
                  default: None,
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "default",
                    position: (34, 9),
                   },
                  ],
                 },
                 String {
                  parts: [
                   Raw {
                    content: "journalbeat",
                    position: (34, 20),
                   },
                  ],
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "description",
                    position: (35, 9),
                   },
                  ],
                 },
                 String {
                  parts: [
                   Raw {
                    content: "Name of the beat",
                    position: (35, 24),
                   },
                  ],
                 },
                ),
               ],
               recursive: false,
               position: (32, 23),
              },
             ],
            },
           ),
           KeyValue(
            AttributePath {
             attributes: [
              Raw {
               content: "tags",
               position: (38, 7),
              },
             ],
            },
            FunctionApplication {
             function: Variable {
              identifier: "mkOption",
              position: (38, 14),
             },
             arguments: [
              Map {
               bindings: [
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "type",
                    position: (39, 9),
                   },
                  ],
                 },
                 FunctionApplication {
                  function: PropertyAccess {
                   expression: Variable {
                    identifier: "types",
                    position: (39, 16),
                   },
                   attribute_path: AttributePath {
                    attributes: [
                     Raw {
                      content: "listOf",
                      position: (39, 22),
                     },
                    ],
                   },
                   default: None,
                  },
                  arguments: [
                   PropertyAccess {
                    expression: Variable {
                     identifier: "types",
                     position: (39, 29),
                    },
                    attribute_path: AttributePath {
                     attributes: [
                      Raw {
                       content: "str",
                       position: (39, 35),
                      },
                     ],
                    },
                    default: None,
                   },
                  ],
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "default",
                    position: (40, 9),
                   },
                  ],
                 },
                 List {
                  elements: [],
                  position: (40, 19),
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "description",
                    position: (41, 9),
                   },
                  ],
                 },
                 String {
                  parts: [
                   Raw {
                    content: "Tags to place on the shipped log messages",
                    position: (41, 24),
                   },
                  ],
                 },
                ),
               ],
               recursive: false,
               position: (38, 23),
              },
             ],
            },
           ),
           KeyValue(
            AttributePath {
             attributes: [
              Raw {
               content: "stateDir",
               position: (44, 7),
              },
             ],
            },
            FunctionApplication {
             function: Variable {
              identifier: "mkOption",
              position: (44, 18),
             },
             arguments: [
              Map {
               bindings: [
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "type",
                    position: (45, 9),
                   },
                  ],
                 },
                 PropertyAccess {
                  expression: Variable {
                   identifier: "types",
                   position: (45, 16),
                  },
                  attribute_path: AttributePath {
                   attributes: [
                    Raw {
                     content: "str",
                     position: (45, 22),
                    },
                   ],
                  },
                  default: None,
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "default",
                    position: (46, 9),
                   },
                  ],
                 },
                 String {
                  parts: [
                   Raw {
                    content: "journalbeat",
                    position: (46, 20),
                   },
                  ],
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "description",
                    position: (47, 9),
                   },
                  ],
                 },
                 String {
                  parts: [
                   Raw {
                    content: "Directory below <literal>/var/lib/</literal> to store journalbeat's\nown logs and other data. This directory will be created automatically\nusing systemd's StateDirectory mechanism.\n",
                    position: (48, 1),
                   },
                  ],
                 },
                ),
               ],
               recursive: false,
               position: (44, 27),
              },
             ],
            },
           ),
           KeyValue(
            AttributePath {
             attributes: [
              Raw {
               content: "extraConfig",
               position: (54, 7),
              },
             ],
            },
            FunctionApplication {
             function: Variable {
              identifier: "mkOption",
              position: (54, 21),
             },
             arguments: [
              Map {
               bindings: [
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "type",
                    position: (55, 9),
                   },
                  ],
                 },
                 PropertyAccess {
                  expression: Variable {
                   identifier: "types",
                   position: (55, 16),
                  },
                  attribute_path: AttributePath {
                   attributes: [
                    Raw {
                     content: "lines",
                     position: (55, 22),
                    },
                   ],
                  },
                  default: None,
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "default",
                    position: (56, 9),
                   },
                  ],
                 },
                 String {
                  parts: [],
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "description",
                    position: (57, 9),
                   },
                  ],
                 },
                 String {
                  parts: [
                   Raw {
                    content: "Any other configuration options you want to add",
                    position: (57, 24),
                   },
                  ],
                 },
                ),
               ],
               recursive: false,
               position: (54, 30),
              },
             ],
            },
           ),
          ],
          recursive: false,
          position: (19, 28),
         },
        ),
       ],
       recursive: false,
       position: (17, 13),
      },
     ),
     KeyValue(
      AttributePath {
       attributes: [
        Raw {
         content: "config",
         position: (63, 3),
        },
       ],
      },
      FunctionApplication {
       function: Variable {
        identifier: "mkIf",
        position: (63, 12),
       },
       arguments: [
        PropertyAccess {
         expression: Variable {
          identifier: "cfg",
          position: (63, 17),
         },
         attribute_path: AttributePath {
          attributes: [
           Raw {
            content: "enable",
            position: (63, 21),
           },
          ],
         },
         default: None,
        },
        Map {
         bindings: [
          KeyValue(
           AttributePath {
            attributes: [
             Raw {
              content: "assertions",
              position: (65, 5),
             },
            ],
           },
           List {
            elements: [
             Map {
              bindings: [
               KeyValue(
                AttributePath {
                 attributes: [
                  Raw {
                   content: "assertion",
                   position: (67, 9),
                  },
                 ],
                },
                UnaryOperation {
                 operator: Not,
                 operand: FunctionApplication {
                  function: Variable {
                   identifier: "hasPrefix",
                   position: (67, 22),
                  },
                  arguments: [
                   String {
                    parts: [
                     Raw {
                      content: "/",
                      position: (67, 33),
                     },
                    ],
                   },
                   PropertyAccess {
                    expression: Variable {
                     identifier: "cfg",
                     position: (67, 36),
                    },
                    attribute_path: AttributePath {
                     attributes: [
                      Raw {
                       content: "stateDir",
                       position: (67, 40),
                      },
                     ],
                    },
                    default: None,
                   },
                  ],
                 },
                 position: (67, 21),
                },
               ),
               KeyValue(
                AttributePath {
                 attributes: [
                  Raw {
                   content: "message",
                   position: (68, 9),
                  },
                 ],
                },
                BinaryOperation {
                 operator: Addition,
                 operands: [
                  String {
                   parts: [
                    Raw {
                     content: "The option services.journalbeat.stateDir shouldn't be an absolute directory.",
                     position: (69, 12),
                    },
                   ],
                  },
                  String {
                   parts: [
                    Raw {
                     content: " It should be a directory relative to /var/lib/.",
                     position: (70, 12),
                    },
                   ],
                  },
                 ],
                 position: (69, 90),
                },
               ),
              ],
              recursive: false,
              position: (66, 7),
             },
            ],
            position: (65, 18),
           },
          ),
          KeyValue(
           AttributePath {
            attributes: [
             Raw {
              content: "systemd",
              position: (74, 5),
             },
             Raw {
              content: "services",
              position: (74, 13),
             },
             Raw {
              content: "journalbeat",
              position: (74, 22),
             },
            ],
           },
           Map {
            bindings: [
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "description",
                 position: (75, 7),
                },
               ],
              },
              String {
               parts: [
                Raw {
                 content: "Journalbeat log shipper",
                 position: (75, 22),
                },
               ],
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "wantedBy",
                 position: (76, 7),
                },
               ],
              },
              List {
               elements: [
                String {
                 parts: [
                  Raw {
                   content: "multi-user.target",
                   position: (76, 21),
                  },
                 ],
                },
               ],
               position: (76, 18),
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "wants",
                 position: (77, 7),
                },
               ],
              },
              List {
               elements: [
                String {
                 parts: [
                  Raw {
                   content: "elasticsearch.service",
                   position: (77, 18),
                  },
                 ],
                },
               ],
               position: (77, 15),
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "after",
                 position: (78, 7),
                },
               ],
              },
              List {
               elements: [
                String {
                 parts: [
                  Raw {
                   content: "elasticsearch.service",
                   position: (78, 18),
                  },
                 ],
                },
               ],
               position: (78, 15),
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "preStart",
                 position: (79, 7),
                },
               ],
              },
              String {
               parts: [
                Raw {
                 content: "mkdir -p ",
                 position: (80, 1),
                },
                Expression {
                 expression: PropertyAccess {
                  expression: Variable {
                   identifier: "cfg",
                   position: (80, 20),
                  },
                  attribute_path: AttributePath {
                   attributes: [
                    Raw {
                     content: "stateDir",
                     position: (80, 24),
                    },
                   ],
                  },
                  default: None,
                 },
                },
                Raw {
                 content: "/data\nmkdir -p ",
                 position: (80, 33),
                },
                Expression {
                 expression: PropertyAccess {
                  expression: Variable {
                   identifier: "cfg",
                   position: (81, 20),
                  },
                  attribute_path: AttributePath {
                   attributes: [
                    Raw {
                     content: "stateDir",
                     position: (81, 24),
                    },
                   ],
                  },
                  default: None,
                 },
                },
                Raw {
                 content: "/logs\n",
                 position: (81, 33),
                },
               ],
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "serviceConfig",
                 position: (83, 7),
                },
               ],
              },
              Map {
               bindings: [
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "StateDirectory",
                    position: (84, 9),
                   },
                  ],
                 },
                 PropertyAccess {
                  expression: Variable {
                   identifier: "cfg",
                   position: (84, 26),
                  },
                  attribute_path: AttributePath {
                   attributes: [
                    Raw {
                     content: "stateDir",
                     position: (84, 30),
                    },
                   ],
                  },
                  default: None,
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "ExecStart",
                    position: (85, 9),
                   },
                  ],
                 },
                 String {
                  parts: [
                   Raw {
                    content: "          ",
                    position: (86, 1),
                   },
                   Expression {
                    expression: PropertyAccess {
                     expression: Variable {
                      identifier: "cfg",
                      position: (86, 13),
                     },
                     attribute_path: AttributePath {
                      attributes: [
                       Raw {
                        content: "package",
                        position: (86, 17),
                       },
                      ],
                     },
                     default: None,
                    },
                   },
                   Raw {
                    content: "/bin/journalbeat \\\n  -c ",
                    position: (86, 25),
                   },
                   Expression {
                    expression: Variable {
                     identifier: "journalbeatYml",
                     position: (87, 18),
                    },
                   },
                   Raw {
                    content: " \\\n  -path.data /var/lib/",
                    position: (87, 33),
                   },
                   Expression {
                    expression: PropertyAccess {
                     expression: Variable {
                      identifier: "cfg",
                      position: (88, 35),
                     },
                     attribute_path: AttributePath {
                      attributes: [
                       Raw {
                        content: "stateDir",
                        position: (88, 39),
                       },
                      ],
                     },
                     default: None,
                    },
                   },
                   Raw {
                    content: "/data \\\n  -path.logs /var/lib/",
                    position: (88, 48),
                   },
                   Expression {
                    expression: PropertyAccess {
                     expression: Variable {
                      identifier: "cfg",
                      position: (89, 35),
                     },
                     attribute_path: AttributePath {
                      attributes: [
                       Raw {
                        content: "stateDir",
                        position: (89, 39),
                       },
                      ],
                     },
                     default: None,
                    },
                   },
                   Raw {
                    content: "/logs",
                    position: (89, 48),
                   },
                  ],
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "Restart",
                    position: (90, 9),
                   },
                  ],
                 },
                 String {
                  parts: [
                   Raw {
                    content: "always",
                    position: (90, 20),
                   },
                  ],
                 },
                ),
               ],
               recursive: false,
               position: (83, 23),
              },
             ),
            ],
            recursive: false,
            position: (74, 36),
           },
          ),
         ],
         recursive: false,
         position: (63, 28),
        },
       ],
      },
     ),
    ],
    recursive: false,
    position: (16, 1),
   },
   position: (5, 1),
  },
  position: (3, 1),
 },
 position: (1, 1),
}