---
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: "ankisyncd",
         position: (6, 25),
        },
       ],
      },
      default: None,
     },
    ),
    KeyValue(
     AttributePath {
      attributes: [
       Raw {
        content: "name",
        position: (8, 3),
       },
      ],
     },
     String {
      parts: [
       Raw {
        content: "ankisyncd",
        position: (8, 11),
       },
      ],
     },
    ),
    KeyValue(
     AttributePath {
      attributes: [
       Raw {
        content: "stateDir",
        position: (10, 3),
       },
      ],
     },
     String {
      parts: [
       Raw {
        content: "/var/lib/",
        position: (10, 15),
       },
       Expression {
        expression: Variable {
         identifier: "name",
         position: (10, 26),
        },
       },
      ],
     },
    ),
    KeyValue(
     AttributePath {
      attributes: [
       Raw {
        content: "authDbPath",
        position: (12, 3),
       },
      ],
     },
     String {
      parts: [
       Expression {
        expression: Variable {
         identifier: "stateDir",
         position: (12, 19),
        },
       },
       Raw {
        content: "/auth.db",
        position: (12, 28),
       },
      ],
     },
    ),
    KeyValue(
     AttributePath {
      attributes: [
       Raw {
        content: "sessionDbPath",
        position: (14, 3),
       },
      ],
     },
     String {
      parts: [
       Expression {
        expression: Variable {
         identifier: "stateDir",
         position: (14, 22),
        },
       },
       Raw {
        content: "/session.db",
        position: (14, 31),
       },
      ],
     },
    ),
    KeyValue(
     AttributePath {
      attributes: [
       Raw {
        content: "configFile",
        position: (16, 3),
       },
      ],
     },
     FunctionApplication {
      function: PropertyAccess {
       expression: Variable {
        identifier: "pkgs",
        position: (16, 16),
       },
       attribute_path: AttributePath {
        attributes: [
         Raw {
          content: "writeText",
          position: (16, 21),
         },
        ],
       },
       default: None,
      },
      arguments: [
       String {
        parts: [
         Raw {
          content: "ankisyncd.conf",
          position: (16, 32),
         },
        ],
       },
       FunctionApplication {
        function: PropertyAccess {
         expression: Variable {
          identifier: "lib",
          position: (16, 49),
         },
         attribute_path: AttributePath {
          attributes: [
           Raw {
            content: "generators",
            position: (16, 53),
           },
           Raw {
            content: "toINI",
            position: (16, 64),
           },
          ],
         },
         default: None,
        },
        arguments: [
         Map {
          bindings: [],
          recursive: false,
          position: (16, 70),
         },
         Map {
          bindings: [
           KeyValue(
            AttributePath {
             attributes: [
              Raw {
               content: "sync_app",
               position: (17, 5),
              },
             ],
            },
            Map {
             bindings: [
              KeyValue(
               AttributePath {
                attributes: [
                 Raw {
                  content: "host",
                  position: (18, 7),
                 },
                ],
               },
               PropertyAccess {
                expression: Variable {
                 identifier: "cfg",
                 position: (18, 14),
                },
                attribute_path: AttributePath {
                 attributes: [
                  Raw {
                   content: "host",
                   position: (18, 18),
                  },
                 ],
                },
                default: None,
               },
              ),
              KeyValue(
               AttributePath {
                attributes: [
                 Raw {
                  content: "port",
                  position: (19, 7),
                 },
                ],
               },
               PropertyAccess {
                expression: Variable {
                 identifier: "cfg",
                 position: (19, 14),
                },
                attribute_path: AttributePath {
                 attributes: [
                  Raw {
                   content: "port",
                   position: (19, 18),
                  },
                 ],
                },
                default: None,
               },
              ),
              KeyValue(
               AttributePath {
                attributes: [
                 Raw {
                  content: "data_root",
                  position: (20, 7),
                 },
                ],
               },
               Variable {
                identifier: "stateDir",
                position: (20, 19),
               },
              ),
              KeyValue(
               AttributePath {
                attributes: [
                 Raw {
                  content: "auth_db_path",
                  position: (21, 7),
                 },
                ],
               },
               Variable {
                identifier: "authDbPath",
                position: (21, 22),
               },
              ),
              KeyValue(
               AttributePath {
                attributes: [
                 Raw {
                  content: "session_db_path",
                  position: (22, 7),
                 },
                ],
               },
               Variable {
                identifier: "sessionDbPath",
                position: (22, 25),
               },
              ),
              KeyValue(
               AttributePath {
                attributes: [
                 Raw {
                  content: "base_url",
                  position: (24, 7),
                 },
                ],
               },
               String {
                parts: [
                 Raw {
                  content: "/sync/",
                  position: (24, 19),
                 },
                ],
               },
              ),
              KeyValue(
               AttributePath {
                attributes: [
                 Raw {
                  content: "base_media_url",
                  position: (25, 7),
                 },
                ],
               },
               String {
                parts: [
                 Raw {
                  content: "/msync/",
                  position: (25, 25),
                 },
                ],
               },
              ),
             ],
             recursive: false,
             position: (17, 16),
            },
           ),
          ],
          recursive: false,
          position: (16, 73),
         },
        ],
       },
      ],
     },
    ),
   ],
   target: Map {
    bindings: [
     KeyValue(
      AttributePath {
       attributes: [
        Raw {
         content: "options",
         position: (30, 5),
        },
        Raw {
         content: "services",
         position: (30, 13),
        },
        Raw {
         content: "ankisyncd",
         position: (30, 22),
        },
       ],
      },
      Map {
       bindings: [
        KeyValue(
         AttributePath {
          attributes: [
           Raw {
            content: "enable",
            position: (31, 7),
           },
          ],
         },
         FunctionApplication {
          function: Variable {
           identifier: "mkEnableOption",
           position: (31, 16),
          },
          arguments: [
           String {
            parts: [
             Raw {
              content: "ankisyncd",
              position: (31, 32),
             },
            ],
           },
          ],
         },
        ),
        KeyValue(
         AttributePath {
          attributes: [
           Raw {
            content: "package",
            position: (33, 7),
           },
          ],
         },
         FunctionApplication {
          function: Variable {
           identifier: "mkOption",
           position: (33, 17),
          },
          arguments: [
           Map {
            bindings: [
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "type",
                 position: (34, 9),
                },
               ],
              },
              PropertyAccess {
               expression: Variable {
                identifier: "types",
                position: (34, 16),
               },
               attribute_path: AttributePath {
                attributes: [
                 Raw {
                  content: "package",
                  position: (34, 22),
                 },
                ],
               },
               default: None,
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "default",
                 position: (35, 9),
                },
               ],
              },
              PropertyAccess {
               expression: Variable {
                identifier: "pkgs",
                position: (35, 19),
               },
               attribute_path: AttributePath {
                attributes: [
                 Raw {
                  content: "ankisyncd",
                  position: (35, 24),
                 },
                ],
               },
               default: None,
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "defaultText",
                 position: (36, 9),
                },
               ],
              },
              FunctionApplication {
               function: Variable {
                identifier: "literalExpression",
                position: (36, 23),
               },
               arguments: [
                String {
                 parts: [
                  Raw {
                   content: "pkgs.ankisyncd",
                   position: (36, 42),
                  },
                 ],
                },
               ],
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "description",
                 position: (37, 9),
                },
               ],
              },
              String {
               parts: [
                Raw {
                 content: "The package to use for the ankisyncd command.",
                 position: (37, 24),
                },
               ],
              },
             ),
            ],
            recursive: false,
            position: (33, 26),
           },
          ],
         },
        ),
        KeyValue(
         AttributePath {
          attributes: [
           Raw {
            content: "host",
            position: (40, 7),
           },
          ],
         },
         FunctionApplication {
          function: Variable {
           identifier: "mkOption",
           position: (40, 14),
          },
          arguments: [
           Map {
            bindings: [
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "type",
                 position: (41, 9),
                },
               ],
              },
              PropertyAccess {
               expression: Variable {
                identifier: "types",
                position: (41, 16),
               },
               attribute_path: AttributePath {
                attributes: [
                 Raw {
                  content: "str",
                  position: (41, 22),
                 },
                ],
               },
               default: None,
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "default",
                 position: (42, 9),
                },
               ],
              },
              String {
               parts: [
                Raw {
                 content: "localhost",
                 position: (42, 20),
                },
               ],
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "description",
                 position: (43, 9),
                },
               ],
              },
              String {
               parts: [
                Raw {
                 content: "ankisyncd host",
                 position: (43, 24),
                },
               ],
              },
             ),
            ],
            recursive: false,
            position: (40, 23),
           },
          ],
         },
        ),
        KeyValue(
         AttributePath {
          attributes: [
           Raw {
            content: "port",
            position: (46, 7),
           },
          ],
         },
         FunctionApplication {
          function: Variable {
           identifier: "mkOption",
           position: (46, 14),
          },
          arguments: [
           Map {
            bindings: [
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "type",
                 position: (47, 9),
                },
               ],
              },
              PropertyAccess {
               expression: Variable {
                identifier: "types",
                position: (47, 16),
               },
               attribute_path: AttributePath {
                attributes: [
                 Raw {
                  content: "int",
                  position: (47, 22),
                 },
                ],
               },
               default: None,
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "default",
                 position: (48, 9),
                },
               ],
              },
              Int {
               value: 27701,
               position: (48, 19),
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "description",
                 position: (49, 9),
                },
               ],
              },
              String {
               parts: [
                Raw {
                 content: "ankisyncd port",
                 position: (49, 24),
                },
               ],
              },
             ),
            ],
            recursive: false,
            position: (46, 23),
           },
          ],
         },
        ),
        KeyValue(
         AttributePath {
          attributes: [
           Raw {
            content: "openFirewall",
            position: (52, 7),
           },
          ],
         },
         FunctionApplication {
          function: Variable {
           identifier: "mkOption",
           position: (52, 22),
          },
          arguments: [
           Map {
            bindings: [
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "default",
                 position: (53, 9),
                },
               ],
              },
              Variable {
               identifier: "false",
               position: (53, 19),
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "type",
                 position: (54, 9),
                },
               ],
              },
              PropertyAccess {
               expression: Variable {
                identifier: "types",
                position: (54, 16),
               },
               attribute_path: AttributePath {
                attributes: [
                 Raw {
                  content: "bool",
                  position: (54, 22),
                 },
                ],
               },
               default: None,
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "description",
                 position: (55, 9),
                },
               ],
              },
              String {
               parts: [
                Raw {
                 content: "Whether to open the firewall for the specified port.",
                 position: (55, 24),
                },
               ],
              },
             ),
            ],
            recursive: false,
            position: (52, 31),
           },
          ],
         },
        ),
       ],
       recursive: false,
       position: (30, 34),
      },
     ),
     KeyValue(
      AttributePath {
       attributes: [
        Raw {
         content: "config",
         position: (59, 5),
        },
       ],
      },
      FunctionApplication {
       function: Variable {
        identifier: "mkIf",
        position: (59, 14),
       },
       arguments: [
        PropertyAccess {
         expression: Variable {
          identifier: "cfg",
          position: (59, 19),
         },
         attribute_path: AttributePath {
          attributes: [
           Raw {
            content: "enable",
            position: (59, 23),
           },
          ],
         },
         default: None,
        },
        Map {
         bindings: [
          KeyValue(
           AttributePath {
            attributes: [
             Raw {
              content: "networking",
              position: (60, 7),
             },
             Raw {
              content: "firewall",
              position: (60, 18),
             },
             Raw {
              content: "allowedTCPPorts",
              position: (60, 27),
             },
            ],
           },
           FunctionApplication {
            function: Variable {
             identifier: "mkIf",
             position: (60, 45),
            },
            arguments: [
             PropertyAccess {
              expression: Variable {
               identifier: "cfg",
               position: (60, 50),
              },
              attribute_path: AttributePath {
               attributes: [
                Raw {
                 content: "openFirewall",
                 position: (60, 54),
                },
               ],
              },
              default: None,
             },
             List {
              elements: [
               PropertyAccess {
                expression: Variable {
                 identifier: "cfg",
                 position: (60, 69),
                },
                attribute_path: AttributePath {
                 attributes: [
                  Raw {
                   content: "port",
                   position: (60, 73),
                  },
                 ],
                },
                default: None,
               },
              ],
              position: (60, 67),
             },
            ],
           },
          ),
          KeyValue(
           AttributePath {
            attributes: [
             Raw {
              content: "environment",
              position: (62, 7),
             },
             Raw {
              content: "etc",
              position: (62, 19),
             },
             Expression {
              expression: String {
               parts: [
                Raw {
                 content: "ankisyncd/ankisyncd.conf",
                 position: (62, 24),
                },
               ],
              },
             },
             Raw {
              content: "source",
              position: (62, 50),
             },
            ],
           },
           Variable {
            identifier: "configFile",
            position: (62, 59),
           },
          ),
          KeyValue(
           AttributePath {
            attributes: [
             Raw {
              content: "systemd",
              position: (64, 7),
             },
             Raw {
              content: "services",
              position: (64, 15),
             },
             Raw {
              content: "ankisyncd",
              position: (64, 24),
             },
            ],
           },
           Map {
            bindings: [
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "description",
                 position: (65, 9),
                },
               ],
              },
              String {
               parts: [
                Raw {
                 content: "ankisyncd - Anki sync server",
                 position: (65, 24),
                },
               ],
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "after",
                 position: (66, 9),
                },
               ],
              },
              List {
               elements: [
                String {
                 parts: [
                  Raw {
                   content: "network.target",
                   position: (66, 20),
                  },
                 ],
                },
               ],
               position: (66, 17),
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "wantedBy",
                 position: (67, 9),
                },
               ],
              },
              List {
               elements: [
                String {
                 parts: [
                  Raw {
                   content: "multi-user.target",
                   position: (67, 23),
                  },
                 ],
                },
               ],
               position: (67, 20),
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "path",
                 position: (68, 9),
                },
               ],
              },
              List {
               elements: [
                PropertyAccess {
                 expression: Variable {
                  identifier: "cfg",
                  position: (68, 18),
                 },
                 attribute_path: AttributePath {
                  attributes: [
                   Raw {
                    content: "package",
                    position: (68, 22),
                   },
                  ],
                 },
                 default: None,
                },
               ],
               position: (68, 16),
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "serviceConfig",
                 position: (70, 9),
                },
               ],
              },
              Map {
               bindings: [
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "Type",
                    position: (71, 11),
                   },
                  ],
                 },
                 String {
                  parts: [
                   Raw {
                    content: "simple",
                    position: (71, 19),
                   },
                  ],
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "DynamicUser",
                    position: (72, 11),
                   },
                  ],
                 },
                 Variable {
                  identifier: "true",
                  position: (72, 25),
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "StateDirectory",
                    position: (73, 11),
                   },
                  ],
                 },
                 Variable {
                  identifier: "name",
                  position: (73, 28),
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "ExecStart",
                    position: (74, 11),
                   },
                  ],
                 },
                 String {
                  parts: [
                   Expression {
                    expression: PropertyAccess {
                     expression: Variable {
                      identifier: "cfg",
                      position: (74, 26),
                     },
                     attribute_path: AttributePath {
                      attributes: [
                       Raw {
                        content: "package",
                        position: (74, 30),
                       },
                      ],
                     },
                     default: None,
                    },
                   },
                   Raw {
                    content: "/bin/ankisyncd",
                    position: (74, 38),
                   },
                  ],
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "Restart",
                    position: (75, 11),
                   },
                  ],
                 },
                 String {
                  parts: [
                   Raw {
                    content: "always",
                    position: (75, 22),
                   },
                  ],
                 },
                ),
               ],
               recursive: false,
               position: (70, 25),
              },
             ),
            ],
            recursive: false,
            position: (64, 36),
           },
          ),
         ],
         recursive: false,
         position: (59, 30),
        },
       ],
      },
     ),
    ],
    recursive: false,
    position: (29, 3),
   },
   position: (5, 1),
  },
  position: (3, 1),
 },
 position: (1, 1),
}