---
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, 11),
      },
      attribute_path: AttributePath {
       attributes: [
        Raw {
         content: "services",
         position: (6, 18),
        },
        Raw {
         content: "minetest-server",
         position: (6, 27),
        },
       ],
      },
      default: None,
     },
    ),
    KeyValue(
     AttributePath {
      attributes: [
       Raw {
        content: "flag",
        position: (7, 3),
       },
      ],
     },
     Function {
      argument: Some(
       "val",
      ),
      arguments: FunctionArguments {
       arguments: [],
       ellipsis: false,
      },
      definition: Function {
       argument: Some(
        "name",
       ),
       arguments: FunctionArguments {
        arguments: [],
        ellipsis: false,
       },
       definition: IfThenElse {
        predicate: BinaryOperation {
         operator: NotEqualTo,
         operands: [
          Variable {
           identifier: "val",
           position: (7, 25),
          },
          Variable {
           identifier: "null",
           position: (7, 32),
          },
         ],
         position: (7, 29),
        },
        then: String {
         parts: [
          Raw {
           content: "--",
           position: (7, 43),
          },
          Expression {
           expression: Variable {
            identifier: "name",
            position: (7, 47),
           },
          },
          Raw {
           content: " ",
           position: (7, 52),
          },
          Expression {
           expression: FunctionApplication {
            function: Variable {
             identifier: "toString",
             position: (7, 55),
            },
            arguments: [
             Variable {
              identifier: "val",
              position: (7, 64),
             },
            ],
           },
          },
          Raw {
           content: " ",
           position: (7, 68),
          },
         ],
        },
        else_: String {
         parts: [],
        },
        position: (7, 22),
       },
       position: (7, 16),
      },
      position: (7, 11),
     },
    ),
    KeyValue(
     AttributePath {
      attributes: [
       Raw {
        content: "flags",
        position: (8, 3),
       },
      ],
     },
     List {
      elements: [
       FunctionApplication {
        function: Variable {
         identifier: "flag",
         position: (9, 6),
        },
        arguments: [
         PropertyAccess {
          expression: Variable {
           identifier: "cfg",
           position: (9, 11),
          },
          attribute_path: AttributePath {
           attributes: [
            Raw {
             content: "gameId",
             position: (9, 15),
            },
           ],
          },
          default: None,
         },
         String {
          parts: [
           Raw {
            content: "gameid",
            position: (9, 23),
           },
          ],
         },
        ],
       },
       FunctionApplication {
        function: Variable {
         identifier: "flag",
         position: (10, 6),
        },
        arguments: [
         PropertyAccess {
          expression: Variable {
           identifier: "cfg",
           position: (10, 11),
          },
          attribute_path: AttributePath {
           attributes: [
            Raw {
             content: "world",
             position: (10, 15),
            },
           ],
          },
          default: None,
         },
         String {
          parts: [
           Raw {
            content: "world",
            position: (10, 22),
           },
          ],
         },
        ],
       },
       FunctionApplication {
        function: Variable {
         identifier: "flag",
         position: (11, 6),
        },
        arguments: [
         PropertyAccess {
          expression: Variable {
           identifier: "cfg",
           position: (11, 11),
          },
          attribute_path: AttributePath {
           attributes: [
            Raw {
             content: "configPath",
             position: (11, 15),
            },
           ],
          },
          default: None,
         },
         String {
          parts: [
           Raw {
            content: "config",
            position: (11, 27),
           },
          ],
         },
        ],
       },
       FunctionApplication {
        function: Variable {
         identifier: "flag",
         position: (12, 6),
        },
        arguments: [
         PropertyAccess {
          expression: Variable {
           identifier: "cfg",
           position: (12, 11),
          },
          attribute_path: AttributePath {
           attributes: [
            Raw {
             content: "logPath",
             position: (12, 15),
            },
           ],
          },
          default: None,
         },
         String {
          parts: [
           Raw {
            content: "logfile",
            position: (12, 24),
           },
          ],
         },
        ],
       },
       FunctionApplication {
        function: Variable {
         identifier: "flag",
         position: (13, 6),
        },
        arguments: [
         PropertyAccess {
          expression: Variable {
           identifier: "cfg",
           position: (13, 11),
          },
          attribute_path: AttributePath {
           attributes: [
            Raw {
             content: "port",
             position: (13, 15),
            },
           ],
          },
          default: None,
         },
         String {
          parts: [
           Raw {
            content: "port",
            position: (13, 21),
           },
          ],
         },
        ],
       },
      ],
      position: (8, 11),
     },
    ),
   ],
   target: Map {
    bindings: [
     KeyValue(
      AttributePath {
       attributes: [
        Raw {
         content: "options",
         position: (17, 3),
        },
       ],
      },
      Map {
       bindings: [
        KeyValue(
         AttributePath {
          attributes: [
           Raw {
            content: "services",
            position: (18, 5),
           },
           Raw {
            content: "minetest-server",
            position: (18, 14),
           },
          ],
         },
         Map {
          bindings: [
           KeyValue(
            AttributePath {
             attributes: [
              Raw {
               content: "enable",
               position: (19, 7),
              },
             ],
            },
            FunctionApplication {
             function: Variable {
              identifier: "mkOption",
              position: (19, 16),
             },
             arguments: [
              Map {
               bindings: [
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "type",
                    position: (20, 9),
                   },
                  ],
                 },
                 PropertyAccess {
                  expression: Variable {
                   identifier: "types",
                   position: (20, 23),
                  },
                  attribute_path: AttributePath {
                   attributes: [
                    Raw {
                     content: "bool",
                     position: (20, 29),
                    },
                   ],
                  },
                  default: None,
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "default",
                    position: (21, 9),
                   },
                  ],
                 },
                 Variable {
                  identifier: "false",
                  position: (21, 23),
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "description",
                    position: (22, 9),
                   },
                  ],
                 },
                 String {
                  parts: [
                   Raw {
                    content: "If enabled, starts a Minetest Server.",
                    position: (22, 24),
                   },
                  ],
                 },
                ),
               ],
               recursive: false,
               position: (19, 25),
              },
             ],
            },
           ),
           KeyValue(
            AttributePath {
             attributes: [
              Raw {
               content: "gameId",
               position: (25, 7),
              },
             ],
            },
            FunctionApplication {
             function: Variable {
              identifier: "mkOption",
              position: (25, 16),
             },
             arguments: [
              Map {
               bindings: [
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "type",
                    position: (26, 9),
                   },
                  ],
                 },
                 FunctionApplication {
                  function: PropertyAccess {
                   expression: Variable {
                    identifier: "types",
                    position: (26, 23),
                   },
                   attribute_path: AttributePath {
                    attributes: [
                     Raw {
                      content: "nullOr",
                      position: (26, 29),
                     },
                    ],
                   },
                   default: None,
                  },
                  arguments: [
                   PropertyAccess {
                    expression: Variable {
                     identifier: "types",
                     position: (26, 36),
                    },
                    attribute_path: AttributePath {
                     attributes: [
                      Raw {
                       content: "str",
                       position: (26, 42),
                      },
                     ],
                    },
                    default: None,
                   },
                  ],
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "default",
                    position: (27, 9),
                   },
                  ],
                 },
                 Variable {
                  identifier: "null",
                  position: (27, 23),
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "description",
                    position: (28, 9),
                   },
                  ],
                 },
                 String {
                  parts: [
                   Raw {
                    content: "Id of the game to use. To list available games run\n`minetestserver --gameid list`.\n\nIf only one game exists, this option can be null.\n",
                    position: (29, 1),
                   },
                  ],
                 },
                ),
               ],
               recursive: false,
               position: (25, 25),
              },
             ],
            },
           ),
           KeyValue(
            AttributePath {
             attributes: [
              Raw {
               content: "world",
               position: (36, 7),
              },
             ],
            },
            FunctionApplication {
             function: Variable {
              identifier: "mkOption",
              position: (36, 15),
             },
             arguments: [
              Map {
               bindings: [
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "type",
                    position: (37, 9),
                   },
                  ],
                 },
                 FunctionApplication {
                  function: PropertyAccess {
                   expression: Variable {
                    identifier: "types",
                    position: (37, 23),
                   },
                   attribute_path: AttributePath {
                    attributes: [
                     Raw {
                      content: "nullOr",
                      position: (37, 29),
                     },
                    ],
                   },
                   default: None,
                  },
                  arguments: [
                   PropertyAccess {
                    expression: Variable {
                     identifier: "types",
                     position: (37, 36),
                    },
                    attribute_path: AttributePath {
                     attributes: [
                      Raw {
                       content: "path",
                       position: (37, 42),
                      },
                     ],
                    },
                    default: None,
                   },
                  ],
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "default",
                    position: (38, 9),
                   },
                  ],
                 },
                 Variable {
                  identifier: "null",
                  position: (38, 23),
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "description",
                    position: (39, 9),
                   },
                  ],
                 },
                 String {
                  parts: [
                   Raw {
                    content: "Name of the world to use. To list available worlds run\n`minetestserver --world list`.\n\nIf only one world exists, this option can be null.\n",
                    position: (40, 1),
                   },
                  ],
                 },
                ),
               ],
               recursive: false,
               position: (36, 24),
              },
             ],
            },
           ),
           KeyValue(
            AttributePath {
             attributes: [
              Raw {
               content: "configPath",
               position: (47, 7),
              },
             ],
            },
            FunctionApplication {
             function: Variable {
              identifier: "mkOption",
              position: (47, 20),
             },
             arguments: [
              Map {
               bindings: [
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "type",
                    position: (48, 9),
                   },
                  ],
                 },
                 FunctionApplication {
                  function: PropertyAccess {
                   expression: Variable {
                    identifier: "types",
                    position: (48, 23),
                   },
                   attribute_path: AttributePath {
                    attributes: [
                     Raw {
                      content: "nullOr",
                      position: (48, 29),
                     },
                    ],
                   },
                   default: None,
                  },
                  arguments: [
                   PropertyAccess {
                    expression: Variable {
                     identifier: "types",
                     position: (48, 36),
                    },
                    attribute_path: AttributePath {
                     attributes: [
                      Raw {
                       content: "path",
                       position: (48, 42),
                      },
                     ],
                    },
                    default: None,
                   },
                  ],
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "default",
                    position: (49, 9),
                   },
                  ],
                 },
                 Variable {
                  identifier: "null",
                  position: (49, 23),
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "description",
                    position: (50, 9),
                   },
                  ],
                 },
                 String {
                  parts: [
                   Raw {
                    content: "Path to the config to use.\n\nIf set to null, the config of the running user will be used:\n`~/.minetest/minetest.conf`.\n",
                    position: (51, 1),
                   },
                  ],
                 },
                ),
               ],
               recursive: false,
               position: (47, 29),
              },
             ],
            },
           ),
           KeyValue(
            AttributePath {
             attributes: [
              Raw {
               content: "logPath",
               position: (58, 7),
              },
             ],
            },
            FunctionApplication {
             function: Variable {
              identifier: "mkOption",
              position: (58, 17),
             },
             arguments: [
              Map {
               bindings: [
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "type",
                    position: (59, 9),
                   },
                  ],
                 },
                 FunctionApplication {
                  function: PropertyAccess {
                   expression: Variable {
                    identifier: "types",
                    position: (59, 23),
                   },
                   attribute_path: AttributePath {
                    attributes: [
                     Raw {
                      content: "nullOr",
                      position: (59, 29),
                     },
                    ],
                   },
                   default: None,
                  },
                  arguments: [
                   PropertyAccess {
                    expression: Variable {
                     identifier: "types",
                     position: (59, 36),
                    },
                    attribute_path: AttributePath {
                     attributes: [
                      Raw {
                       content: "path",
                       position: (59, 42),
                      },
                     ],
                    },
                    default: None,
                   },
                  ],
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "default",
                    position: (60, 9),
                   },
                  ],
                 },
                 Variable {
                  identifier: "null",
                  position: (60, 23),
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "description",
                    position: (61, 9),
                   },
                  ],
                 },
                 String {
                  parts: [
                   Raw {
                    content: "Path to logfile for logging.\n\nIf set to null, logging will be output to stdout which means\nall output will be catched by systemd.\n",
                    position: (62, 1),
                   },
                  ],
                 },
                ),
               ],
               recursive: false,
               position: (58, 26),
              },
             ],
            },
           ),
           KeyValue(
            AttributePath {
             attributes: [
              Raw {
               content: "port",
               position: (69, 7),
              },
             ],
            },
            FunctionApplication {
             function: Variable {
              identifier: "mkOption",
              position: (69, 14),
             },
             arguments: [
              Map {
               bindings: [
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "type",
                    position: (70, 9),
                   },
                  ],
                 },
                 FunctionApplication {
                  function: PropertyAccess {
                   expression: Variable {
                    identifier: "types",
                    position: (70, 23),
                   },
                   attribute_path: AttributePath {
                    attributes: [
                     Raw {
                      content: "nullOr",
                      position: (70, 29),
                     },
                    ],
                   },
                   default: None,
                  },
                  arguments: [
                   PropertyAccess {
                    expression: Variable {
                     identifier: "types",
                     position: (70, 36),
                    },
                    attribute_path: AttributePath {
                     attributes: [
                      Raw {
                       content: "int",
                       position: (70, 42),
                      },
                     ],
                    },
                    default: None,
                   },
                  ],
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "default",
                    position: (71, 9),
                   },
                  ],
                 },
                 Variable {
                  identifier: "null",
                  position: (71, 23),
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "description",
                    position: (72, 9),
                   },
                  ],
                 },
                 String {
                  parts: [
                   Raw {
                    content: "Port number to bind to.\n\nIf set to null, the default 30000 will be used.\n",
                    position: (73, 1),
                   },
                  ],
                 },
                ),
               ],
               recursive: false,
               position: (69, 23),
              },
             ],
            },
           ),
          ],
          recursive: false,
          position: (18, 32),
         },
        ),
       ],
       recursive: false,
       position: (17, 13),
      },
     ),
     KeyValue(
      AttributePath {
       attributes: [
        Raw {
         content: "config",
         position: (81, 3),
        },
       ],
      },
      FunctionApplication {
       function: Variable {
        identifier: "mkIf",
        position: (81, 12),
       },
       arguments: [
        PropertyAccess {
         expression: Variable {
          identifier: "cfg",
          position: (81, 17),
         },
         attribute_path: AttributePath {
          attributes: [
           Raw {
            content: "enable",
            position: (81, 21),
           },
          ],
         },
         default: None,
        },
        Map {
         bindings: [
          KeyValue(
           AttributePath {
            attributes: [
             Raw {
              content: "users",
              position: (82, 5),
             },
             Raw {
              content: "users",
              position: (82, 11),
             },
             Raw {
              content: "minetest",
              position: (82, 17),
             },
            ],
           },
           Map {
            bindings: [
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "description",
                 position: (83, 7),
                },
               ],
              },
              String {
               parts: [
                Raw {
                 content: "Minetest Server Service user",
                 position: (83, 26),
                },
               ],
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "home",
                 position: (84, 7),
                },
               ],
              },
              String {
               parts: [
                Raw {
                 content: "/var/lib/minetest",
                 position: (84, 26),
                },
               ],
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "createHome",
                 position: (85, 7),
                },
               ],
              },
              Variable {
               identifier: "true",
               position: (85, 25),
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "uid",
                 position: (86, 7),
                },
               ],
              },
              PropertyAccess {
               expression: Variable {
                identifier: "config",
                position: (86, 25),
               },
               attribute_path: AttributePath {
                attributes: [
                 Raw {
                  content: "ids",
                  position: (86, 32),
                 },
                 Raw {
                  content: "uids",
                  position: (86, 36),
                 },
                 Raw {
                  content: "minetest",
                  position: (86, 41),
                 },
                ],
               },
               default: None,
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "group",
                 position: (87, 7),
                },
               ],
              },
              String {
               parts: [
                Raw {
                 content: "minetest",
                 position: (87, 26),
                },
               ],
              },
             ),
            ],
            recursive: false,
            position: (82, 28),
           },
          ),
          KeyValue(
           AttributePath {
            attributes: [
             Raw {
              content: "users",
              position: (89, 5),
             },
             Raw {
              content: "groups",
              position: (89, 11),
             },
             Raw {
              content: "minetest",
              position: (89, 18),
             },
             Raw {
              content: "gid",
              position: (89, 27),
             },
            ],
           },
           PropertyAccess {
            expression: Variable {
             identifier: "config",
             position: (89, 33),
            },
            attribute_path: AttributePath {
             attributes: [
              Raw {
               content: "ids",
               position: (89, 40),
              },
              Raw {
               content: "gids",
               position: (89, 44),
              },
              Raw {
               content: "minetest",
               position: (89, 49),
              },
             ],
            },
            default: None,
           },
          ),
          KeyValue(
           AttributePath {
            attributes: [
             Raw {
              content: "systemd",
              position: (91, 5),
             },
             Raw {
              content: "services",
              position: (91, 13),
             },
             Raw {
              content: "minetest-server",
              position: (91, 22),
             },
            ],
           },
           Map {
            bindings: [
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "description",
                 position: (92, 7),
                },
               ],
              },
              String {
               parts: [
                Raw {
                 content: "Minetest Server Service",
                 position: (92, 24),
                },
               ],
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "wantedBy",
                 position: (93, 7),
                },
               ],
              },
              List {
               elements: [
                String {
                 parts: [
                  Raw {
                   content: "multi-user.target",
                   position: (93, 26),
                  },
                 ],
                },
               ],
               position: (93, 23),
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "after",
                 position: (94, 7),
                },
               ],
              },
              List {
               elements: [
                String {
                 parts: [
                  Raw {
                   content: "network.target",
                   position: (94, 26),
                  },
                 ],
                },
               ],
               position: (94, 23),
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "serviceConfig",
                 position: (96, 7),
                },
                Raw {
                 content: "Restart",
                 position: (96, 21),
                },
               ],
              },
              String {
               parts: [
                Raw {
                 content: "always",
                 position: (96, 32),
                },
               ],
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "serviceConfig",
                 position: (97, 7),
                },
                Raw {
                 content: "User",
                 position: (97, 21),
                },
               ],
              },
              String {
               parts: [
                Raw {
                 content: "minetest",
                 position: (97, 32),
                },
               ],
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "serviceConfig",
                 position: (98, 7),
                },
                Raw {
                 content: "Group",
                 position: (98, 21),
                },
               ],
              },
              String {
               parts: [
                Raw {
                 content: "minetest",
                 position: (98, 32),
                },
               ],
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "script",
                 position: (100, 7),
                },
               ],
              },
              String {
               parts: [
                Raw {
                 content: "cd /var/lib/minetest\n\nexec ",
                 position: (101, 1),
                },
                Expression {
                 expression: PropertyAccess {
                  expression: Variable {
                   identifier: "pkgs",
                   position: (103, 16),
                  },
                  attribute_path: AttributePath {
                   attributes: [
                    Raw {
                     content: "minetest",
                     position: (103, 21),
                    },
                   ],
                  },
                  default: None,
                 },
                },
                Raw {
                 content: "/bin/minetest --server ",
                 position: (103, 30),
                },
                Expression {
                 expression: FunctionApplication {
                  function: Variable {
                   identifier: "concatStrings",
                   position: (103, 55),
                  },
                  arguments: [
                   Variable {
                    identifier: "flags",
                    position: (103, 69),
                   },
                  ],
                 },
                },
                Raw {
                 content: "\n",
                 position: (103, 75),
                },
               ],
              },
             ),
            ],
            recursive: false,
            position: (91, 40),
           },
          ),
         ],
         recursive: false,
         position: (81, 28),
        },
       ],
      },
     ),
    ],
    recursive: false,
    position: (16, 1),
   },
   position: (5, 1),
  },
  position: (3, 1),
 },
 position: (1, 1),
}