---
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: (7, 3),
       },
      ],
     },
     to: PropertyAccess {
      expression: Variable {
       identifier: "config",
       position: (7, 9),
      },
      attribute_path: AttributePath {
       parts: [
        Raw {
         content: "services",
         position: (7, 16),
        },
        Raw {
         content: "davmail",
         position: (7, 25),
        },
       ],
      },
      default: None,
     },
    },
    Binding {
     from: AttributePath {
      parts: [
       Raw {
        content: "configType",
        position: (9, 3),
       },
      ],
     },
     to: With {
      expression: Variable {
       identifier: "types",
       position: (9, 21),
      },
      target: BinaryOperation {
       operator: Update,
       operands: [
        FunctionApplication {
         function: Variable {
          identifier: "oneOf",
          position: (10, 5),
         },
         arguments: [
          List {
           elements: [
            Parentheses {
             expression: FunctionApplication {
              function: Variable {
               identifier: "attrsOf",
               position: (10, 14),
              },
              arguments: [
               Variable {
                identifier: "configType",
                position: (10, 22),
               },
              ],
             },
             position: (10, 13),
            },
            Variable {
             identifier: "str",
             position: (10, 34),
            },
            Variable {
             identifier: "int",
             position: (10, 38),
            },
            Variable {
             identifier: "bool",
             position: (10, 42),
            },
           ],
           position: (10, 11),
          },
         ],
        },
        Map {
         bindings: [
          Binding {
           from: AttributePath {
            parts: [
             Raw {
              content: "description",
              position: (11, 7),
             },
            ],
           },
           to: String {
            parts: [
             Raw {
              content: "davmail config type (str, int, bool or attribute set thereof)",
              position: (11, 22),
             },
            ],
            position: (11, 21),
           },
          },
         ],
         recursive: false,
         position: (10, 52),
        },
       ],
       position: (10, 49),
      },
      position: (9, 16),
     },
    },
    Binding {
     from: AttributePath {
      parts: [
       Raw {
        content: "toStr",
        position: (14, 3),
       },
      ],
     },
     to: Function {
      argument: Simple {
       identifier: "val",
      },
      definition: IfThenElse {
       predicate: FunctionApplication {
        function: Variable {
         identifier: "isBool",
         position: (14, 19),
        },
        arguments: [
         Variable {
          identifier: "val",
          position: (14, 26),
         },
        ],
       },
       then: FunctionApplication {
        function: Variable {
         identifier: "boolToString",
         position: (14, 35),
        },
        arguments: [
         Variable {
          identifier: "val",
          position: (14, 48),
         },
        ],
       },
       else_: FunctionApplication {
        function: Variable {
         identifier: "toString",
         position: (14, 57),
        },
        arguments: [
         Variable {
          identifier: "val",
          position: (14, 66),
         },
        ],
       },
       position: (14, 16),
      },
      position: (14, 11),
     },
    },
    Binding {
     from: AttributePath {
      parts: [
       Raw {
        content: "linesForAttrs",
        position: (16, 3),
       },
      ],
     },
     to: Function {
      argument: Simple {
       identifier: "attrs",
      },
      definition: FunctionApplication {
       function: Variable {
        identifier: "concatMap",
        position: (16, 26),
       },
       arguments: [
        Parentheses {
         expression: Function {
          argument: Simple {
           identifier: "name",
          },
          definition: LetIn {
           bindings: [
            Binding {
             from: AttributePath {
              parts: [
               Raw {
                content: "value",
                position: (16, 47),
               },
              ],
             },
             to: PropertyAccess {
              expression: Variable {
               identifier: "attrs",
               position: (16, 55),
              },
              attribute_path: AttributePath {
               parts: [
                Interpolation {
                 expression: Variable {
                  identifier: "name",
                  position: (16, 63),
                 },
                },
               ],
              },
              default: None,
             },
            },
           ],
           target: IfThenElse {
            predicate: FunctionApplication {
             function: Variable {
              identifier: "isAttrs",
              position: (17, 8),
             },
             arguments: [
              Variable {
               identifier: "value",
               position: (17, 16),
              },
             ],
            },
            then: FunctionApplication {
             function: Variable {
              identifier: "map",
              position: (18, 12),
             },
             arguments: [
              Parentheses {
               expression: Function {
                argument: Simple {
                 identifier: "line",
                },
                definition: BinaryOperation {
                 operator: Addition,
                 operands: [
                  BinaryOperation {
                   operator: Addition,
                   operands: [
                    Variable {
                     identifier: "name",
                     position: (18, 23),
                    },
                    String {
                     parts: [
                      Raw {
                       content: ".",
                       position: (18, 31),
                      },
                     ],
                     position: (18, 30),
                    },
                   ],
                   position: (18, 28),
                  },
                  Variable {
                   identifier: "line",
                   position: (18, 36),
                  },
                 ],
                 position: (18, 34),
                },
                position: (18, 17),
               },
               position: (18, 16),
              },
              Parentheses {
               expression: FunctionApplication {
                function: Variable {
                 identifier: "linesForAttrs",
                 position: (18, 43),
                },
                arguments: [
                 Variable {
                  identifier: "value",
                  position: (18, 57),
                 },
                ],
               },
               position: (18, 42),
              },
             ],
            },
            else_: List {
             elements: [
              String {
               parts: [
                Interpolation {
                 expression: Variable {
                  identifier: "name",
                  position: (19, 17),
                 },
                },
                Raw {
                 content: "=",
                 position: (19, 22),
                },
                Interpolation {
                 expression: FunctionApplication {
                  function: Variable {
                   identifier: "toStr",
                   position: (19, 25),
                  },
                  arguments: [
                   Variable {
                    identifier: "value",
                    position: (19, 31),
                   },
                  ],
                 },
                },
               ],
               position: (19, 14),
              },
             ],
             position: (19, 12),
            },
            position: (17, 5),
           },
           position: (16, 43),
          },
          position: (16, 37),
         },
         position: (16, 36),
        },
        Parentheses {
         expression: FunctionApplication {
          function: Variable {
           identifier: "attrNames",
           position: (20, 6),
          },
          arguments: [
           Variable {
            identifier: "attrs",
            position: (20, 16),
           },
          ],
         },
         position: (20, 5),
        },
       ],
      },
      position: (16, 19),
     },
    },
    Binding {
     from: AttributePath {
      parts: [
       Raw {
        content: "configFile",
        position: (22, 3),
       },
      ],
     },
     to: FunctionApplication {
      function: PropertyAccess {
       expression: Variable {
        identifier: "pkgs",
        position: (22, 16),
       },
       attribute_path: AttributePath {
        parts: [
         Raw {
          content: "writeText",
          position: (22, 21),
         },
        ],
       },
       default: None,
      },
      arguments: [
       String {
        parts: [
         Raw {
          content: "davmail.properties",
          position: (22, 32),
         },
        ],
        position: (22, 31),
       },
       Parentheses {
        expression: FunctionApplication {
         function: Variable {
          identifier: "concatStringsSep",
          position: (22, 53),
         },
         arguments: [
          String {
           parts: [
            Raw {
             content: "\n",
             position: (22, 71),
            },
           ],
           position: (22, 70),
          },
          Parentheses {
           expression: FunctionApplication {
            function: Variable {
             identifier: "linesForAttrs",
             position: (22, 76),
            },
            arguments: [
             PropertyAccess {
              expression: Variable {
               identifier: "cfg",
               position: (22, 90),
              },
              attribute_path: AttributePath {
               parts: [
                Raw {
                 content: "config",
                 position: (22, 94),
                },
               ],
              },
              default: None,
             },
            ],
           },
           position: (22, 75),
          },
         ],
        },
        position: (22, 52),
       },
      ],
     },
    },
   ],
   target: Map {
    bindings: [
     Binding {
      from: AttributePath {
       parts: [
        Raw {
         content: "options",
         position: (27, 5),
        },
        Raw {
         content: "services",
         position: (27, 13),
        },
        Raw {
         content: "davmail",
         position: (27, 22),
        },
       ],
      },
      to: Map {
       bindings: [
        Binding {
         from: AttributePath {
          parts: [
           Raw {
            content: "enable",
            position: (28, 7),
           },
          ],
         },
         to: FunctionApplication {
          function: Variable {
           identifier: "mkEnableOption",
           position: (28, 16),
          },
          arguments: [
           String {
            parts: [
             Raw {
              content: "davmail, an MS Exchange gateway",
              position: (28, 32),
             },
            ],
            position: (28, 31),
           },
          ],
         },
        },
        Binding {
         from: AttributePath {
          parts: [
           Raw {
            content: "url",
            position: (30, 7),
           },
          ],
         },
         to: FunctionApplication {
          function: Variable {
           identifier: "mkOption",
           position: (30, 13),
          },
          arguments: [
           Map {
            bindings: [
             Binding {
              from: AttributePath {
               parts: [
                Raw {
                 content: "type",
                 position: (31, 9),
                },
               ],
              },
              to: PropertyAccess {
               expression: Variable {
                identifier: "types",
                position: (31, 16),
               },
               attribute_path: AttributePath {
                parts: [
                 Raw {
                  content: "str",
                  position: (31, 22),
                 },
                ],
               },
               default: None,
              },
             },
             Binding {
              from: AttributePath {
               parts: [
                Raw {
                 content: "description",
                 position: (32, 9),
                },
               ],
              },
              to: String {
               parts: [
                Raw {
                 content: "Outlook Web Access URL to access the exchange server, i.e. the base webmail URL.",
                 position: (32, 24),
                },
               ],
               position: (32, 23),
              },
             },
             Binding {
              from: AttributePath {
               parts: [
                Raw {
                 content: "example",
                 position: (33, 9),
                },
               ],
              },
              to: String {
               parts: [
                Raw {
                 content: "https://outlook.office365.com/EWS/Exchange.asmx",
                 position: (33, 20),
                },
               ],
               position: (33, 19),
              },
             },
            ],
            recursive: false,
            position: (30, 22),
           },
          ],
         },
        },
        Binding {
         from: AttributePath {
          parts: [
           Raw {
            content: "config",
            position: (36, 7),
           },
          ],
         },
         to: FunctionApplication {
          function: Variable {
           identifier: "mkOption",
           position: (36, 16),
          },
          arguments: [
           Map {
            bindings: [
             Binding {
              from: AttributePath {
               parts: [
                Raw {
                 content: "type",
                 position: (37, 9),
                },
               ],
              },
              to: Variable {
               identifier: "configType",
               position: (37, 16),
              },
             },
             Binding {
              from: AttributePath {
               parts: [
                Raw {
                 content: "default",
                 position: (38, 9),
                },
               ],
              },
              to: Map {
               bindings: [],
               recursive: false,
               position: (38, 19),
              },
             },
             Binding {
              from: AttributePath {
               parts: [
                Raw {
                 content: "description",
                 position: (39, 9),
                },
               ],
              },
              to: String {
               parts: [
                Raw {
                 content: "Davmail configuration. Refer to\n<link xlink:href=\"http://davmail.sourceforge.net/serversetup.html\"/>\nand <link xlink:href=\"http://davmail.sourceforge.net/advanced.html\"/>\nfor details on supported values.\n",
                 position: (40, 1),
                },
               ],
               position: (39, 23),
              },
             },
             Binding {
              from: AttributePath {
               parts: [
                Raw {
                 content: "example",
                 position: (45, 9),
                },
               ],
              },
              to: FunctionApplication {
               function: Variable {
                identifier: "literalExpression",
                position: (45, 19),
               },
               arguments: [
                String {
                 parts: [
                  Raw {
                   content: "{\n  davmail.allowRemote = true;\n  davmail.imapPort = 55555;\n  davmail.bindAddress = \"10.0.1.2\";\n  davmail.smtpSaveInSent = true;\n  davmail.folderSizeLimit = 10;\n  davmail.caldavAutoSchedule = false;\n  log4j.logger.rootLogger = \"DEBUG\";\n}\n",
                   position: (46, 1),
                  },
                 ],
                 position: (45, 37),
                },
               ],
              },
             },
            ],
            recursive: false,
            position: (36, 25),
           },
          ],
         },
        },
       ],
       recursive: false,
       position: (27, 32),
      },
     },
     Binding {
      from: AttributePath {
       parts: [
        Raw {
         content: "config",
         position: (59, 5),
        },
       ],
      },
      to: FunctionApplication {
       function: Variable {
        identifier: "mkIf",
        position: (59, 14),
       },
       arguments: [
        PropertyAccess {
         expression: Variable {
          identifier: "cfg",
          position: (59, 19),
         },
         attribute_path: AttributePath {
          parts: [
           Raw {
            content: "enable",
            position: (59, 23),
           },
          ],
         },
         default: None,
        },
        Map {
         bindings: [
          Binding {
           from: AttributePath {
            parts: [
             Raw {
              content: "services",
              position: (61, 7),
             },
             Raw {
              content: "davmail",
              position: (61, 16),
             },
             Raw {
              content: "config",
              position: (61, 24),
             },
            ],
           },
           to: Map {
            bindings: [
             Binding {
              from: AttributePath {
               parts: [
                Raw {
                 content: "davmail",
                 position: (62, 9),
                },
               ],
              },
              to: FunctionApplication {
               function: Variable {
                identifier: "mapAttrs",
                position: (62, 19),
               },
               arguments: [
                Parentheses {
                 expression: Function {
                  argument: Simple {
                   identifier: "name",
                  },
                  definition: Variable {
                   identifier: "mkDefault",
                   position: (62, 35),
                  },
                  position: (62, 29),
                 },
                 position: (62, 28),
                },
                Map {
                 bindings: [
                  Binding {
                   from: AttributePath {
                    parts: [
                     Raw {
                      content: "server",
                      position: (63, 11),
                     },
                    ],
                   },
                   to: Variable {
                    identifier: "true",
                    position: (63, 20),
                   },
                  },
                  Binding {
                   from: AttributePath {
                    parts: [
                     Raw {
                      content: "disableUpdateCheck",
                      position: (64, 11),
                     },
                    ],
                   },
                   to: Variable {
                    identifier: "true",
                    position: (64, 32),
                   },
                  },
                  Binding {
                   from: AttributePath {
                    parts: [
                     Raw {
                      content: "logFilePath",
                      position: (65, 11),
                     },
                    ],
                   },
                   to: String {
                    parts: [
                     Raw {
                      content: "/var/log/davmail/davmail.log",
                      position: (65, 26),
                     },
                    ],
                    position: (65, 25),
                   },
                  },
                  Binding {
                   from: AttributePath {
                    parts: [
                     Raw {
                      content: "logFileSize",
                      position: (66, 11),
                     },
                    ],
                   },
                   to: String {
                    parts: [
                     Raw {
                      content: "1MB",
                      position: (66, 26),
                     },
                    ],
                    position: (66, 25),
                   },
                  },
                  Binding {
                   from: AttributePath {
                    parts: [
                     Raw {
                      content: "mode",
                      position: (67, 11),
                     },
                    ],
                   },
                   to: String {
                    parts: [
                     Raw {
                      content: "auto",
                      position: (67, 19),
                     },
                    ],
                    position: (67, 18),
                   },
                  },
                  Binding {
                   from: AttributePath {
                    parts: [
                     Raw {
                      content: "url",
                      position: (68, 11),
                     },
                    ],
                   },
                   to: PropertyAccess {
                    expression: Variable {
                     identifier: "cfg",
                     position: (68, 17),
                    },
                    attribute_path: AttributePath {
                     parts: [
                      Raw {
                       content: "url",
                       position: (68, 21),
                      },
                     ],
                    },
                    default: None,
                   },
                  },
                  Binding {
                   from: AttributePath {
                    parts: [
                     Raw {
                      content: "caldavPort",
                      position: (69, 11),
                     },
                    ],
                   },
                   to: Int {
                    value: 1080,
                    position: (69, 24),
                   },
                  },
                  Binding {
                   from: AttributePath {
                    parts: [
                     Raw {
                      content: "imapPort",
                      position: (70, 11),
                     },
                    ],
                   },
                   to: Int {
                    value: 1143,
                    position: (70, 22),
                   },
                  },
                  Binding {
                   from: AttributePath {
                    parts: [
                     Raw {
                      content: "ldapPort",
                      position: (71, 11),
                     },
                    ],
                   },
                   to: Int {
                    value: 1389,
                    position: (71, 22),
                   },
                  },
                  Binding {
                   from: AttributePath {
                    parts: [
                     Raw {
                      content: "popPort",
                      position: (72, 11),
                     },
                    ],
                   },
                   to: Int {
                    value: 1110,
                    position: (72, 21),
                   },
                  },
                  Binding {
                   from: AttributePath {
                    parts: [
                     Raw {
                      content: "smtpPort",
                      position: (73, 11),
                     },
                    ],
                   },
                   to: Int {
                    value: 1025,
                    position: (73, 22),
                   },
                  },
                 ],
                 recursive: false,
                 position: (62, 46),
                },
               ],
              },
             },
             Binding {
              from: AttributePath {
               parts: [
                Raw {
                 content: "log4j",
                 position: (75, 9),
                },
               ],
              },
              to: Map {
               bindings: [
                Binding {
                 from: AttributePath {
                  parts: [
                   Raw {
                    content: "logger",
                    position: (76, 11),
                   },
                   Raw {
                    content: "davmail",
                    position: (76, 18),
                   },
                  ],
                 },
                 to: FunctionApplication {
                  function: Variable {
                   identifier: "mkDefault",
                   position: (76, 28),
                  },
                  arguments: [
                   String {
                    parts: [
                     Raw {
                      content: "WARN",
                      position: (76, 39),
                     },
                    ],
                    position: (76, 38),
                   },
                  ],
                 },
                },
                Binding {
                 from: AttributePath {
                  parts: [
                   Raw {
                    content: "logger",
                    position: (77, 11),
                   },
                   Raw {
                    content: "httpclient",
                    position: (77, 18),
                   },
                   Raw {
                    content: "wire",
                    position: (77, 29),
                   },
                  ],
                 },
                 to: FunctionApplication {
                  function: Variable {
                   identifier: "mkDefault",
                   position: (77, 36),
                  },
                  arguments: [
                   String {
                    parts: [
                     Raw {
                      content: "WARN",
                      position: (77, 47),
                     },
                    ],
                    position: (77, 46),
                   },
                  ],
                 },
                },
                Binding {
                 from: AttributePath {
                  parts: [
                   Raw {
                    content: "logger",
                    position: (78, 11),
                   },
                   Raw {
                    content: "org",
                    position: (78, 18),
                   },
                   Raw {
                    content: "apache",
                    position: (78, 22),
                   },
                   Raw {
                    content: "commons",
                    position: (78, 29),
                   },
                   Raw {
                    content: "httpclient",
                    position: (78, 37),
                   },
                  ],
                 },
                 to: FunctionApplication {
                  function: Variable {
                   identifier: "mkDefault",
                   position: (78, 50),
                  },
                  arguments: [
                   String {
                    parts: [
                     Raw {
                      content: "WARN",
                      position: (78, 61),
                     },
                    ],
                    position: (78, 60),
                   },
                  ],
                 },
                },
                Binding {
                 from: AttributePath {
                  parts: [
                   Raw {
                    content: "rootLogger",
                    position: (79, 11),
                   },
                  ],
                 },
                 to: FunctionApplication {
                  function: Variable {
                   identifier: "mkDefault",
                   position: (79, 24),
                  },
                  arguments: [
                   String {
                    parts: [
                     Raw {
                      content: "WARN",
                      position: (79, 35),
                     },
                    ],
                    position: (79, 34),
                   },
                  ],
                 },
                },
               ],
               recursive: false,
               position: (75, 17),
              },
             },
            ],
            recursive: false,
            position: (61, 33),
           },
          },
          Binding {
           from: AttributePath {
            parts: [
             Raw {
              content: "systemd",
              position: (83, 7),
             },
             Raw {
              content: "services",
              position: (83, 15),
             },
             Raw {
              content: "davmail",
              position: (83, 24),
             },
            ],
           },
           to: Map {
            bindings: [
             Binding {
              from: AttributePath {
               parts: [
                Raw {
                 content: "description",
                 position: (84, 9),
                },
               ],
              },
              to: String {
               parts: [
                Raw {
                 content: "DavMail POP/IMAP/SMTP Exchange Gateway",
                 position: (84, 24),
                },
               ],
               position: (84, 23),
              },
             },
             Binding {
              from: AttributePath {
               parts: [
                Raw {
                 content: "after",
                 position: (85, 9),
                },
               ],
              },
              to: List {
               elements: [
                String {
                 parts: [
                  Raw {
                   content: "network.target",
                   position: (85, 20),
                  },
                 ],
                 position: (85, 19),
                },
               ],
               position: (85, 17),
              },
             },
             Binding {
              from: AttributePath {
               parts: [
                Raw {
                 content: "wantedBy",
                 position: (86, 9),
                },
               ],
              },
              to: List {
               elements: [
                String {
                 parts: [
                  Raw {
                   content: "multi-user.target",
                   position: (86, 23),
                  },
                 ],
                 position: (86, 22),
                },
               ],
               position: (86, 20),
              },
             },
             Binding {
              from: AttributePath {
               parts: [
                Raw {
                 content: "serviceConfig",
                 position: (88, 9),
                },
               ],
              },
              to: Map {
               bindings: [
                Binding {
                 from: AttributePath {
                  parts: [
                   Raw {
                    content: "Type",
                    position: (89, 11),
                   },
                  ],
                 },
                 to: String {
                  parts: [
                   Raw {
                    content: "simple",
                    position: (89, 19),
                   },
                  ],
                  position: (89, 18),
                 },
                },
                Binding {
                 from: AttributePath {
                  parts: [
                   Raw {
                    content: "ExecStart",
                    position: (90, 11),
                   },
                  ],
                 },
                 to: String {
                  parts: [
                   Interpolation {
                    expression: PropertyAccess {
                     expression: Variable {
                      identifier: "pkgs",
                      position: (90, 26),
                     },
                     attribute_path: AttributePath {
                      parts: [
                       Raw {
                        content: "davmail",
                        position: (90, 31),
                       },
                      ],
                     },
                     default: None,
                    },
                   },
                   Raw {
                    content: "/bin/davmail ",
                    position: (90, 39),
                   },
                   Interpolation {
                    expression: Variable {
                     identifier: "configFile",
                     position: (90, 54),
                    },
                   },
                  ],
                  position: (90, 23),
                 },
                },
                Binding {
                 from: AttributePath {
                  parts: [
                   Raw {
                    content: "Restart",
                    position: (91, 11),
                   },
                  ],
                 },
                 to: String {
                  parts: [
                   Raw {
                    content: "on-failure",
                    position: (91, 22),
                   },
                  ],
                  position: (91, 21),
                 },
                },
                Binding {
                 from: AttributePath {
                  parts: [
                   Raw {
                    content: "DynamicUser",
                    position: (92, 11),
                   },
                  ],
                 },
                 to: String {
                  parts: [
                   Raw {
                    content: "yes",
                    position: (92, 26),
                   },
                  ],
                  position: (92, 25),
                 },
                },
                Binding {
                 from: AttributePath {
                  parts: [
                   Raw {
                    content: "LogsDirectory",
                    position: (93, 11),
                   },
                  ],
                 },
                 to: String {
                  parts: [
                   Raw {
                    content: "davmail",
                    position: (93, 28),
                   },
                  ],
                  position: (93, 27),
                 },
                },
               ],
               recursive: false,
               position: (88, 25),
              },
             },
            ],
            recursive: false,
            position: (83, 34),
           },
          },
          Binding {
           from: AttributePath {
            parts: [
             Raw {
              content: "environment",
              position: (97, 7),
             },
             Raw {
              content: "systemPackages",
              position: (97, 19),
             },
            ],
           },
           to: List {
            elements: [
             PropertyAccess {
              expression: Variable {
               identifier: "pkgs",
               position: (97, 38),
              },
              attribute_path: AttributePath {
               parts: [
                Raw {
                 content: "davmail",
                 position: (97, 43),
                },
               ],
              },
              default: None,
             },
            ],
            position: (97, 36),
           },
          },
         ],
         recursive: false,
         position: (59, 30),
        },
       ],
      },
     },
    ],
    recursive: false,
    position: (26, 3),
   },
   position: (5, 1),
  },
  position: (3, 1),
 },
 position: (1, 1),
}