---
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: (7, 3),
       },
      ],
     },
     PropertyAccess {
      expression: Variable {
       identifier: "config",
       position: (7, 9),
      },
      attribute_path: AttributePath {
       attributes: [
        Raw {
         content: "services",
         position: (7, 16),
        },
        Raw {
         content: "serviio",
         position: (7, 25),
        },
       ],
      },
      default: None,
     },
    ),
    KeyValue(
     AttributePath {
      attributes: [
       Raw {
        content: "serviioStart",
        position: (9, 3),
       },
      ],
     },
     FunctionApplication {
      function: PropertyAccess {
       expression: Variable {
        identifier: "pkgs",
        position: (9, 18),
       },
       attribute_path: AttributePath {
        attributes: [
         Raw {
          content: "writeScript",
          position: (9, 23),
         },
        ],
       },
       default: None,
      },
      arguments: [
       String {
        parts: [
         Raw {
          content: "serviio.sh",
          position: (9, 36),
         },
        ],
       },
       String {
        parts: [
         Raw {
          content: "#!",
          position: (10, 1),
         },
         Expression {
          expression: PropertyAccess {
           expression: Variable {
            identifier: "pkgs",
            position: (10, 9),
           },
           attribute_path: AttributePath {
            attributes: [
             Raw {
              content: "bash",
              position: (10, 14),
             },
            ],
           },
           default: None,
          },
         },
         Raw {
          content: "/bin/sh\n\nSERVIIO_HOME=",
          position: (10, 19),
         },
         Expression {
          expression: PropertyAccess {
           expression: Variable {
            identifier: "pkgs",
            position: (12, 20),
           },
           attribute_path: AttributePath {
            attributes: [
             Raw {
              content: "serviio",
              position: (12, 25),
             },
            ],
           },
           default: None,
          },
         },
         Raw {
          content: "\n\n# Setup the classpath\nSERVIIO_CLASS_PATH=\"$SERVIIO_HOME/lib/*:$SERVIIO_HOME/config\"\n\n# Setup Serviio specific properties\nJAVA_OPTS=\"-Djava.net.preferIPv4Stack=true -Djava.awt.headless=true -Dorg.restlet.engine.loggerFacadeClass=org.restlet.ext.slf4j.Slf4jLoggerFacade\n           -Dderby.system.home=",
          position: (12, 33),
         },
         Expression {
          expression: PropertyAccess {
           expression: Variable {
            identifier: "cfg",
            position: (19, 38),
           },
           attribute_path: AttributePath {
            attributes: [
             Raw {
              content: "dataDir",
              position: (19, 42),
             },
            ],
           },
           default: None,
          },
         },
         Raw {
          content: "/library -Dserviio.home=",
          position: (19, 50),
         },
         Expression {
          expression: PropertyAccess {
           expression: Variable {
            identifier: "cfg",
            position: (19, 76),
           },
           attribute_path: AttributePath {
            attributes: [
             Raw {
              content: "dataDir",
              position: (19, 80),
             },
            ],
           },
           default: None,
          },
         },
         Raw {
          content: " -Dffmpeg.location=",
          position: (19, 88),
         },
         Expression {
          expression: PropertyAccess {
           expression: Variable {
            identifier: "pkgs",
            position: (19, 109),
           },
           attribute_path: AttributePath {
            attributes: [
             Raw {
              content: "ffmpeg",
              position: (19, 114),
             },
            ],
           },
           default: None,
          },
         },
         Raw {
          content: "/bin/ffmpeg -Ddcraw.location=",
          position: (19, 121),
         },
         Expression {
          expression: PropertyAccess {
           expression: Variable {
            identifier: "pkgs",
            position: (19, 152),
           },
           attribute_path: AttributePath {
            attributes: [
             Raw {
              content: "dcraw",
              position: (19, 157),
             },
            ],
           },
           default: None,
          },
         },
         Raw {
          content: "/bin/dcraw\"\n\n# Execute the JVM in the foreground\nexec ",
          position: (19, 163),
         },
         Expression {
          expression: PropertyAccess {
           expression: Variable {
            identifier: "pkgs",
            position: (22, 12),
           },
           attribute_path: AttributePath {
            attributes: [
             Raw {
              content: "jre",
              position: (22, 17),
             },
            ],
           },
           default: None,
          },
         },
         Raw {
          content: "/bin/java -Xmx512M -Xms20M -XX:+UseG1GC -XX:GCTimeRatio=1 -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=20 $JAVA_OPTS -classpath \"$SERVIIO_CLASS_PATH\" org.serviio.MediaServer \"$@\"\n",
          position: (22, 21),
         },
        ],
       },
      ],
     },
    ),
   ],
   target: Map {
    bindings: [
     KeyValue(
      AttributePath {
       attributes: [
        Raw {
         content: "options",
         position: (28, 3),
        },
       ],
      },
      Map {
       bindings: [
        KeyValue(
         AttributePath {
          attributes: [
           Raw {
            content: "services",
            position: (29, 5),
           },
           Raw {
            content: "serviio",
            position: (29, 14),
           },
          ],
         },
         Map {
          bindings: [
           KeyValue(
            AttributePath {
             attributes: [
              Raw {
               content: "enable",
               position: (31, 7),
              },
             ],
            },
            FunctionApplication {
             function: Variable {
              identifier: "mkOption",
              position: (31, 16),
             },
             arguments: [
              Map {
               bindings: [
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "type",
                    position: (32, 9),
                   },
                  ],
                 },
                 PropertyAccess {
                  expression: Variable {
                   identifier: "types",
                   position: (32, 16),
                  },
                  attribute_path: AttributePath {
                   attributes: [
                    Raw {
                     content: "bool",
                     position: (32, 22),
                    },
                   ],
                  },
                  default: None,
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "default",
                    position: (33, 9),
                   },
                  ],
                 },
                 Variable {
                  identifier: "false",
                  position: (33, 19),
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "description",
                    position: (34, 9),
                   },
                  ],
                 },
                 String {
                  parts: [
                   Raw {
                    content: "Whether to enable the Serviio Media Server.\n",
                    position: (35, 1),
                   },
                  ],
                 },
                ),
               ],
               recursive: false,
               position: (31, 25),
              },
             ],
            },
           ),
           KeyValue(
            AttributePath {
             attributes: [
              Raw {
               content: "dataDir",
               position: (39, 7),
              },
             ],
            },
            FunctionApplication {
             function: Variable {
              identifier: "mkOption",
              position: (39, 17),
             },
             arguments: [
              Map {
               bindings: [
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "type",
                    position: (40, 9),
                   },
                  ],
                 },
                 PropertyAccess {
                  expression: Variable {
                   identifier: "types",
                   position: (40, 16),
                  },
                  attribute_path: AttributePath {
                   attributes: [
                    Raw {
                     content: "path",
                     position: (40, 22),
                    },
                   ],
                  },
                  default: None,
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "default",
                    position: (41, 9),
                   },
                  ],
                 },
                 String {
                  parts: [
                   Raw {
                    content: "/var/lib/serviio",
                    position: (41, 20),
                   },
                  ],
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "description",
                    position: (42, 9),
                   },
                  ],
                 },
                 String {
                  parts: [
                   Raw {
                    content: "The directory where serviio stores its state, data, etc.\n",
                    position: (43, 1),
                   },
                  ],
                 },
                ),
               ],
               recursive: false,
               position: (39, 26),
              },
             ],
            },
           ),
          ],
          recursive: false,
          position: (29, 24),
         },
        ),
       ],
       recursive: false,
       position: (28, 13),
      },
     ),
     KeyValue(
      AttributePath {
       attributes: [
        Raw {
         content: "config",
         position: (52, 3),
        },
       ],
      },
      FunctionApplication {
       function: Variable {
        identifier: "mkIf",
        position: (52, 12),
       },
       arguments: [
        PropertyAccess {
         expression: Variable {
          identifier: "cfg",
          position: (52, 17),
         },
         attribute_path: AttributePath {
          attributes: [
           Raw {
            content: "enable",
            position: (52, 21),
           },
          ],
         },
         default: None,
        },
        Map {
         bindings: [
          KeyValue(
           AttributePath {
            attributes: [
             Raw {
              content: "systemd",
              position: (53, 5),
             },
             Raw {
              content: "services",
              position: (53, 13),
             },
             Raw {
              content: "serviio",
              position: (53, 22),
             },
            ],
           },
           Map {
            bindings: [
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "description",
                 position: (54, 7),
                },
               ],
              },
              String {
               parts: [
                Raw {
                 content: "Serviio Media Server",
                 position: (54, 22),
                },
               ],
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "after",
                 position: (55, 7),
                },
               ],
              },
              List {
               elements: [
                String {
                 parts: [
                  Raw {
                   content: "network.target",
                   position: (55, 18),
                  },
                 ],
                },
               ],
               position: (55, 15),
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "wantedBy",
                 position: (56, 7),
                },
               ],
              },
              List {
               elements: [
                String {
                 parts: [
                  Raw {
                   content: "multi-user.target",
                   position: (56, 21),
                  },
                 ],
                },
               ],
               position: (56, 18),
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "path",
                 position: (57, 7),
                },
               ],
              },
              List {
               elements: [
                PropertyAccess {
                 expression: Variable {
                  identifier: "pkgs",
                  position: (57, 16),
                 },
                 attribute_path: AttributePath {
                  attributes: [
                   Raw {
                    content: "serviio",
                    position: (57, 21),
                   },
                  ],
                 },
                 default: None,
                },
               ],
               position: (57, 14),
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "serviceConfig",
                 position: (58, 7),
                },
               ],
              },
              Map {
               bindings: [
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "User",
                    position: (59, 9),
                   },
                  ],
                 },
                 String {
                  parts: [
                   Raw {
                    content: "serviio",
                    position: (59, 17),
                   },
                  ],
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "Group",
                    position: (60, 9),
                   },
                  ],
                 },
                 String {
                  parts: [
                   Raw {
                    content: "serviio",
                    position: (60, 18),
                   },
                  ],
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "ExecStart",
                    position: (61, 9),
                   },
                  ],
                 },
                 String {
                  parts: [
                   Expression {
                    expression: Variable {
                     identifier: "serviioStart",
                     position: (61, 24),
                    },
                   },
                  ],
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "ExecStop",
                    position: (62, 9),
                   },
                  ],
                 },
                 String {
                  parts: [
                   Expression {
                    expression: Variable {
                     identifier: "serviioStart",
                     position: (62, 23),
                    },
                   },
                   Raw {
                    content: " -stop",
                    position: (62, 36),
                   },
                  ],
                 },
                ),
               ],
               recursive: false,
               position: (58, 23),
              },
             ),
            ],
            recursive: false,
            position: (53, 32),
           },
          ),
          KeyValue(
           AttributePath {
            attributes: [
             Raw {
              content: "users",
              position: (66, 5),
             },
             Raw {
              content: "users",
              position: (66, 11),
             },
             Raw {
              content: "serviio",
              position: (66, 17),
             },
            ],
           },
           Map {
            bindings: [
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "group",
                 position: (67, 9),
                },
               ],
              },
              String {
               parts: [
                Raw {
                 content: "serviio",
                 position: (67, 18),
                },
               ],
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "home",
                 position: (68, 9),
                },
               ],
              },
              PropertyAccess {
               expression: Variable {
                identifier: "cfg",
                position: (68, 16),
               },
               attribute_path: AttributePath {
                attributes: [
                 Raw {
                  content: "dataDir",
                  position: (68, 20),
                 },
                ],
               },
               default: None,
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "description",
                 position: (69, 9),
                },
               ],
              },
              String {
               parts: [
                Raw {
                 content: "Serviio Media Server User",
                 position: (69, 24),
                },
               ],
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "createHome",
                 position: (70, 9),
                },
               ],
              },
              Variable {
               identifier: "true",
               position: (70, 22),
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "isSystemUser",
                 position: (71, 9),
                },
               ],
              },
              Variable {
               identifier: "true",
               position: (71, 24),
              },
             ),
            ],
            recursive: false,
            position: (67, 7),
           },
          ),
          KeyValue(
           AttributePath {
            attributes: [
             Raw {
              content: "users",
              position: (74, 5),
             },
             Raw {
              content: "groups",
              position: (74, 11),
             },
             Raw {
              content: "serviio",
              position: (74, 18),
             },
            ],
           },
           Map {
            bindings: [],
            recursive: false,
            position: (74, 28),
           },
          ),
          KeyValue(
           AttributePath {
            attributes: [
             Raw {
              content: "networking",
              position: (76, 5),
             },
             Raw {
              content: "firewall",
              position: (76, 16),
             },
            ],
           },
           Map {
            bindings: [
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "allowedTCPPorts",
                 position: (77, 7),
                },
               ],
              },
              List {
               elements: [
                Int {
                 value: 8895,
                 position: (78, 9),
                },
                Int {
                 value: 23423,
                 position: (79, 9),
                },
                Int {
                 value: 23424,
                 position: (80, 9),
                },
               ],
               position: (77, 25),
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "allowedUDPPorts",
                 position: (82, 7),
                },
               ],
              },
              List {
               elements: [
                Int {
                 value: 1900,
                 position: (83, 9),
                },
               ],
               position: (82, 25),
              },
             ),
            ],
            recursive: false,
            position: (76, 27),
           },
          ),
         ],
         recursive: false,
         position: (52, 28),
        },
       ],
      },
     ),
    ],
    recursive: false,
    position: (25, 4),
   },
   position: (5, 1),
  },
  position: (3, 1),
 },
 position: (1, 1),
}