---
Function {
 argument: None,
 arguments: FunctionArguments {
  arguments: [
   FunctionArgument {
    identifier: "lib",
    default: None,
   },
   FunctionArgument {
    identifier: "pkgs",
    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: "duplicati",
         position: (6, 25),
        },
       ],
      },
      default: None,
     },
    ),
   ],
   target: Map {
    bindings: [
     KeyValue(
      AttributePath {
       attributes: [
        Raw {
         content: "options",
         position: (9, 3),
        },
       ],
      },
      Map {
       bindings: [
        KeyValue(
         AttributePath {
          attributes: [
           Raw {
            content: "services",
            position: (10, 5),
           },
           Raw {
            content: "duplicati",
            position: (10, 14),
           },
          ],
         },
         Map {
          bindings: [
           KeyValue(
            AttributePath {
             attributes: [
              Raw {
               content: "enable",
               position: (11, 7),
              },
             ],
            },
            FunctionApplication {
             function: Variable {
              identifier: "mkEnableOption",
              position: (11, 16),
             },
             arguments: [
              String {
               parts: [
                Raw {
                 content: "Duplicati",
                 position: (11, 32),
                },
               ],
              },
             ],
            },
           ),
           KeyValue(
            AttributePath {
             attributes: [
              Raw {
               content: "port",
               position: (13, 7),
              },
             ],
            },
            FunctionApplication {
             function: Variable {
              identifier: "mkOption",
              position: (13, 14),
             },
             arguments: [
              Map {
               bindings: [
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "default",
                    position: (14, 9),
                   },
                  ],
                 },
                 Int {
                  value: 8200,
                  position: (14, 19),
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "type",
                    position: (15, 9),
                   },
                  ],
                 },
                 PropertyAccess {
                  expression: Variable {
                   identifier: "types",
                   position: (15, 16),
                  },
                  attribute_path: AttributePath {
                   attributes: [
                    Raw {
                     content: "int",
                     position: (15, 22),
                    },
                   ],
                  },
                  default: None,
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "description",
                    position: (16, 9),
                   },
                  ],
                 },
                 String {
                  parts: [
                   Raw {
                    content: "Port serving the web interface\n",
                    position: (17, 1),
                   },
                  ],
                 },
                ),
               ],
               recursive: false,
               position: (13, 23),
              },
             ],
            },
           ),
           KeyValue(
            AttributePath {
             attributes: [
              Raw {
               content: "dataDir",
               position: (21, 7),
              },
             ],
            },
            FunctionApplication {
             function: Variable {
              identifier: "mkOption",
              position: (21, 17),
             },
             arguments: [
              Map {
               bindings: [
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "type",
                    position: (22, 9),
                   },
                  ],
                 },
                 PropertyAccess {
                  expression: Variable {
                   identifier: "types",
                   position: (22, 16),
                  },
                  attribute_path: AttributePath {
                   attributes: [
                    Raw {
                     content: "str",
                     position: (22, 22),
                    },
                   ],
                  },
                  default: None,
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "default",
                    position: (23, 9),
                   },
                  ],
                 },
                 String {
                  parts: [
                   Raw {
                    content: "/var/lib/duplicati",
                    position: (23, 20),
                   },
                  ],
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "description",
                    position: (24, 9),
                   },
                  ],
                 },
                 String {
                  parts: [
                   Raw {
                    content: "The directory where Duplicati stores its data files.\n\n<note><para>\n  If left as the default value this directory will automatically be created\n  before the Duplicati server starts, otherwise you are responsible for ensuring\n  the directory exists with appropriate ownership and permissions.\n</para></note>\n",
                    position: (25, 1),
                   },
                  ],
                 },
                ),
               ],
               recursive: false,
               position: (21, 26),
              },
             ],
            },
           ),
           KeyValue(
            AttributePath {
             attributes: [
              Raw {
               content: "interface",
               position: (35, 7),
              },
             ],
            },
            FunctionApplication {
             function: Variable {
              identifier: "mkOption",
              position: (35, 19),
             },
             arguments: [
              Map {
               bindings: [
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "default",
                    position: (36, 9),
                   },
                  ],
                 },
                 String {
                  parts: [
                   Raw {
                    content: "127.0.0.1",
                    position: (36, 20),
                   },
                  ],
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "type",
                    position: (37, 9),
                   },
                  ],
                 },
                 PropertyAccess {
                  expression: Variable {
                   identifier: "types",
                   position: (37, 16),
                  },
                  attribute_path: AttributePath {
                   attributes: [
                    Raw {
                     content: "str",
                     position: (37, 22),
                    },
                   ],
                  },
                  default: None,
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "description",
                    position: (38, 9),
                   },
                  ],
                 },
                 String {
                  parts: [
                   Raw {
                    content: "Listening interface for the web UI\nSet it to \"any\" to listen on all available interfaces\n",
                    position: (39, 1),
                   },
                  ],
                 },
                ),
               ],
               recursive: false,
               position: (35, 28),
              },
             ],
            },
           ),
           KeyValue(
            AttributePath {
             attributes: [
              Raw {
               content: "user",
               position: (44, 7),
              },
             ],
            },
            FunctionApplication {
             function: Variable {
              identifier: "mkOption",
              position: (44, 14),
             },
             arguments: [
              Map {
               bindings: [
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "default",
                    position: (45, 9),
                   },
                  ],
                 },
                 String {
                  parts: [
                   Raw {
                    content: "duplicati",
                    position: (45, 20),
                   },
                  ],
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "type",
                    position: (46, 9),
                   },
                  ],
                 },
                 PropertyAccess {
                  expression: Variable {
                   identifier: "types",
                   position: (46, 16),
                  },
                  attribute_path: AttributePath {
                   attributes: [
                    Raw {
                     content: "str",
                     position: (46, 22),
                    },
                   ],
                  },
                  default: None,
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "description",
                    position: (47, 9),
                   },
                  ],
                 },
                 String {
                  parts: [
                   Raw {
                    content: "Duplicati runs as it's own user. It will only be able to backup world-readable files.\nRun as root with special care.\n",
                    position: (48, 1),
                   },
                  ],
                 },
                ),
               ],
               recursive: false,
               position: (44, 23),
              },
             ],
            },
           ),
          ],
          recursive: false,
          position: (10, 26),
         },
        ),
       ],
       recursive: false,
       position: (9, 13),
      },
     ),
     KeyValue(
      AttributePath {
       attributes: [
        Raw {
         content: "config",
         position: (55, 3),
        },
       ],
      },
      FunctionApplication {
       function: Variable {
        identifier: "mkIf",
        position: (55, 12),
       },
       arguments: [
        PropertyAccess {
         expression: Variable {
          identifier: "cfg",
          position: (55, 17),
         },
         attribute_path: AttributePath {
          attributes: [
           Raw {
            content: "enable",
            position: (55, 21),
           },
          ],
         },
         default: None,
        },
        Map {
         bindings: [
          KeyValue(
           AttributePath {
            attributes: [
             Raw {
              content: "environment",
              position: (56, 5),
             },
             Raw {
              content: "systemPackages",
              position: (56, 17),
             },
            ],
           },
           List {
            elements: [
             PropertyAccess {
              expression: Variable {
               identifier: "pkgs",
               position: (56, 36),
              },
              attribute_path: AttributePath {
               attributes: [
                Raw {
                 content: "duplicati",
                 position: (56, 41),
                },
               ],
              },
              default: None,
             },
            ],
            position: (56, 34),
           },
          ),
          KeyValue(
           AttributePath {
            attributes: [
             Raw {
              content: "systemd",
              position: (58, 5),
             },
             Raw {
              content: "services",
              position: (58, 13),
             },
             Raw {
              content: "duplicati",
              position: (58, 22),
             },
            ],
           },
           Map {
            bindings: [
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "description",
                 position: (59, 7),
                },
               ],
              },
              String {
               parts: [
                Raw {
                 content: "Duplicati backup",
                 position: (59, 22),
                },
               ],
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "after",
                 position: (60, 7),
                },
               ],
              },
              List {
               elements: [
                String {
                 parts: [
                  Raw {
                   content: "network.target",
                   position: (60, 18),
                  },
                 ],
                },
               ],
               position: (60, 15),
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "wantedBy",
                 position: (61, 7),
                },
               ],
              },
              List {
               elements: [
                String {
                 parts: [
                  Raw {
                   content: "multi-user.target",
                   position: (61, 21),
                  },
                 ],
                },
               ],
               position: (61, 18),
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "serviceConfig",
                 position: (62, 7),
                },
               ],
              },
              FunctionApplication {
               function: Variable {
                identifier: "mkMerge",
                position: (62, 23),
               },
               arguments: [
                List {
                 elements: [
                  Map {
                   bindings: [
                    KeyValue(
                     AttributePath {
                      attributes: [
                       Raw {
                        content: "User",
                        position: (64, 11),
                       },
                      ],
                     },
                     PropertyAccess {
                      expression: Variable {
                       identifier: "cfg",
                       position: (64, 18),
                      },
                      attribute_path: AttributePath {
                       attributes: [
                        Raw {
                         content: "user",
                         position: (64, 22),
                        },
                       ],
                      },
                      default: None,
                     },
                    ),
                    KeyValue(
                     AttributePath {
                      attributes: [
                       Raw {
                        content: "Group",
                        position: (65, 11),
                       },
                      ],
                     },
                     String {
                      parts: [
                       Raw {
                        content: "duplicati",
                        position: (65, 20),
                       },
                      ],
                     },
                    ),
                    KeyValue(
                     AttributePath {
                      attributes: [
                       Raw {
                        content: "ExecStart",
                        position: (66, 11),
                       },
                      ],
                     },
                     String {
                      parts: [
                       Expression {
                        expression: PropertyAccess {
                         expression: Variable {
                          identifier: "pkgs",
                          position: (66, 26),
                         },
                         attribute_path: AttributePath {
                          attributes: [
                           Raw {
                            content: "duplicati",
                            position: (66, 31),
                           },
                          ],
                         },
                         default: None,
                        },
                       },
                       Raw {
                        content: "/bin/duplicati-server --webservice-interface=",
                        position: (66, 41),
                       },
                       Expression {
                        expression: PropertyAccess {
                         expression: Variable {
                          identifier: "cfg",
                          position: (66, 88),
                         },
                         attribute_path: AttributePath {
                          attributes: [
                           Raw {
                            content: "interface",
                            position: (66, 92),
                           },
                          ],
                         },
                         default: None,
                        },
                       },
                       Raw {
                        content: " --webservice-port=",
                        position: (66, 102),
                       },
                       Expression {
                        expression: FunctionApplication {
                         function: Variable {
                          identifier: "toString",
                          position: (66, 123),
                         },
                         arguments: [
                          PropertyAccess {
                           expression: Variable {
                            identifier: "cfg",
                            position: (66, 132),
                           },
                           attribute_path: AttributePath {
                            attributes: [
                             Raw {
                              content: "port",
                              position: (66, 136),
                             },
                            ],
                           },
                           default: None,
                          },
                         ],
                        },
                       },
                       Raw {
                        content: " --server-datafolder=",
                        position: (66, 141),
                       },
                       Expression {
                        expression: PropertyAccess {
                         expression: Variable {
                          identifier: "cfg",
                          position: (66, 164),
                         },
                         attribute_path: AttributePath {
                          attributes: [
                           Raw {
                            content: "dataDir",
                            position: (66, 168),
                           },
                          ],
                         },
                         default: None,
                        },
                       },
                      ],
                     },
                    ),
                    KeyValue(
                     AttributePath {
                      attributes: [
                       Raw {
                        content: "Restart",
                        position: (67, 11),
                       },
                      ],
                     },
                     String {
                      parts: [
                       Raw {
                        content: "on-failure",
                        position: (67, 22),
                       },
                      ],
                     },
                    ),
                   ],
                   recursive: false,
                   position: (63, 9),
                  },
                  FunctionApplication {
                   function: Variable {
                    identifier: "mkIf",
                    position: (69, 10),
                   },
                   arguments: [
                    BinaryOperation {
                     operator: EqualTo,
                     operands: [
                      PropertyAccess {
                       expression: Variable {
                        identifier: "cfg",
                        position: (69, 16),
                       },
                       attribute_path: AttributePath {
                        attributes: [
                         Raw {
                          content: "dataDir",
                          position: (69, 20),
                         },
                        ],
                       },
                       default: None,
                      },
                      String {
                       parts: [
                        Raw {
                         content: "/var/lib/duplicati",
                         position: (69, 32),
                        },
                       ],
                      },
                     ],
                     position: (69, 28),
                    },
                    Map {
                     bindings: [
                      KeyValue(
                       AttributePath {
                        attributes: [
                         Raw {
                          content: "StateDirectory",
                          position: (70, 11),
                         },
                        ],
                       },
                       String {
                        parts: [
                         Raw {
                          content: "duplicati",
                          position: (70, 29),
                         },
                        ],
                       },
                      ),
                     ],
                     recursive: false,
                     position: (69, 53),
                    },
                   ],
                  },
                 ],
                 position: (62, 31),
                },
               ],
              },
             ),
            ],
            recursive: false,
            position: (58, 34),
           },
          ),
          KeyValue(
           AttributePath {
            attributes: [
             Raw {
              content: "users",
              position: (75, 5),
             },
             Raw {
              content: "users",
              position: (75, 11),
             },
            ],
           },
           FunctionApplication {
            function: PropertyAccess {
             expression: Variable {
              identifier: "lib",
              position: (75, 19),
             },
             attribute_path: AttributePath {
              attributes: [
               Raw {
                content: "optionalAttrs",
                position: (75, 23),
               },
              ],
             },
             default: None,
            },
            arguments: [
             BinaryOperation {
              operator: EqualTo,
              operands: [
               PropertyAccess {
                expression: Variable {
                 identifier: "cfg",
                 position: (75, 38),
                },
                attribute_path: AttributePath {
                 attributes: [
                  Raw {
                   content: "user",
                   position: (75, 42),
                  },
                 ],
                },
                default: None,
               },
               String {
                parts: [
                 Raw {
                  content: "duplicati",
                  position: (75, 51),
                 },
                ],
               },
              ],
              position: (75, 47),
             },
             Map {
              bindings: [
               KeyValue(
                AttributePath {
                 attributes: [
                  Raw {
                   content: "duplicati",
                   position: (76, 7),
                  },
                 ],
                },
                Map {
                 bindings: [
                  KeyValue(
                   AttributePath {
                    attributes: [
                     Raw {
                      content: "uid",
                      position: (77, 9),
                     },
                    ],
                   },
                   PropertyAccess {
                    expression: Variable {
                     identifier: "config",
                     position: (77, 15),
                    },
                    attribute_path: AttributePath {
                     attributes: [
                      Raw {
                       content: "ids",
                       position: (77, 22),
                      },
                      Raw {
                       content: "uids",
                       position: (77, 26),
                      },
                      Raw {
                       content: "duplicati",
                       position: (77, 31),
                      },
                     ],
                    },
                    default: None,
                   },
                  ),
                  KeyValue(
                   AttributePath {
                    attributes: [
                     Raw {
                      content: "home",
                      position: (78, 9),
                     },
                    ],
                   },
                   PropertyAccess {
                    expression: Variable {
                     identifier: "cfg",
                     position: (78, 16),
                    },
                    attribute_path: AttributePath {
                     attributes: [
                      Raw {
                       content: "dataDir",
                       position: (78, 20),
                      },
                     ],
                    },
                    default: None,
                   },
                  ),
                  KeyValue(
                   AttributePath {
                    attributes: [
                     Raw {
                      content: "group",
                      position: (79, 9),
                     },
                    ],
                   },
                   String {
                    parts: [
                     Raw {
                      content: "duplicati",
                      position: (79, 18),
                     },
                    ],
                   },
                  ),
                 ],
                 recursive: false,
                 position: (76, 19),
                },
               ),
              ],
              recursive: false,
              position: (75, 63),
             },
            ],
           },
          ),
          KeyValue(
           AttributePath {
            attributes: [
             Raw {
              content: "users",
              position: (82, 5),
             },
             Raw {
              content: "groups",
              position: (82, 11),
             },
             Raw {
              content: "duplicati",
              position: (82, 18),
             },
             Raw {
              content: "gid",
              position: (82, 28),
             },
            ],
           },
           PropertyAccess {
            expression: Variable {
             identifier: "config",
             position: (82, 34),
            },
            attribute_path: AttributePath {
             attributes: [
              Raw {
               content: "ids",
               position: (82, 41),
              },
              Raw {
               content: "gids",
               position: (82, 45),
              },
              Raw {
               content: "duplicati",
               position: (82, 50),
              },
             ],
            },
            default: None,
           },
          ),
         ],
         recursive: false,
         position: (55, 28),
        },
       ],
      },
     ),
    ],
    recursive: false,
    position: (8, 1),
   },
   position: (5, 1),
  },
  position: (3, 1),
 },
 position: (1, 1),
}