---
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: "rethinkdb",
         position: (6, 25),
        },
       ],
      },
      default: None,
     },
    ),
    KeyValue(
     AttributePath {
      attributes: [
       Raw {
        content: "rethinkdb",
        position: (7, 3),
       },
      ],
     },
     PropertyAccess {
      expression: Variable {
       identifier: "cfg",
       position: (7, 15),
      },
      attribute_path: AttributePath {
       attributes: [
        Raw {
         content: "package",
         position: (7, 19),
        },
       ],
      },
      default: None,
     },
    ),
   ],
   target: Map {
    bindings: [
     KeyValue(
      AttributePath {
       attributes: [
        Raw {
         content: "options",
         position: (14, 3),
        },
       ],
      },
      Map {
       bindings: [
        KeyValue(
         AttributePath {
          attributes: [
           Raw {
            content: "services",
            position: (16, 5),
           },
           Raw {
            content: "rethinkdb",
            position: (16, 14),
           },
          ],
         },
         Map {
          bindings: [
           KeyValue(
            AttributePath {
             attributes: [
              Raw {
               content: "enable",
               position: (18, 7),
              },
             ],
            },
            FunctionApplication {
             function: Variable {
              identifier: "mkEnableOption",
              position: (18, 16),
             },
             arguments: [
              String {
               parts: [
                Raw {
                 content: "RethinkDB server",
                 position: (18, 32),
                },
               ],
              },
             ],
            },
           ),
           KeyValue(
            AttributePath {
             attributes: [
              Raw {
               content: "user",
               position: (25, 7),
              },
             ],
            },
            FunctionApplication {
             function: Variable {
              identifier: "mkOption",
              position: (25, 14),
             },
             arguments: [
              Map {
               bindings: [
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "default",
                    position: (26, 9),
                   },
                  ],
                 },
                 String {
                  parts: [
                   Raw {
                    content: "rethinkdb",
                    position: (26, 20),
                   },
                  ],
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "description",
                    position: (27, 9),
                   },
                  ],
                 },
                 String {
                  parts: [
                   Raw {
                    content: "User account under which RethinkDB runs.",
                    position: (27, 24),
                   },
                  ],
                 },
                ),
               ],
               recursive: false,
               position: (25, 23),
              },
             ],
            },
           ),
           KeyValue(
            AttributePath {
             attributes: [
              Raw {
               content: "group",
               position: (30, 7),
              },
             ],
            },
            FunctionApplication {
             function: Variable {
              identifier: "mkOption",
              position: (30, 15),
             },
             arguments: [
              Map {
               bindings: [
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "default",
                    position: (31, 9),
                   },
                  ],
                 },
                 String {
                  parts: [
                   Raw {
                    content: "rethinkdb",
                    position: (31, 20),
                   },
                  ],
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "description",
                    position: (32, 9),
                   },
                  ],
                 },
                 String {
                  parts: [
                   Raw {
                    content: "Group which rethinkdb user belongs to.",
                    position: (32, 24),
                   },
                  ],
                 },
                ),
               ],
               recursive: false,
               position: (30, 24),
              },
             ],
            },
           ),
           KeyValue(
            AttributePath {
             attributes: [
              Raw {
               content: "dbpath",
               position: (35, 7),
              },
             ],
            },
            FunctionApplication {
             function: Variable {
              identifier: "mkOption",
              position: (35, 16),
             },
             arguments: [
              Map {
               bindings: [
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "default",
                    position: (36, 9),
                   },
                  ],
                 },
                 String {
                  parts: [
                   Raw {
                    content: "/var/db/rethinkdb",
                    position: (36, 20),
                   },
                  ],
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "description",
                    position: (37, 9),
                   },
                  ],
                 },
                 String {
                  parts: [
                   Raw {
                    content: "Location where RethinkDB stores its data, 1 data directory per instance.",
                    position: (37, 24),
                   },
                  ],
                 },
                ),
               ],
               recursive: false,
               position: (35, 25),
              },
             ],
            },
           ),
           KeyValue(
            AttributePath {
             attributes: [
              Raw {
               content: "pidpath",
               position: (40, 7),
              },
             ],
            },
            FunctionApplication {
             function: Variable {
              identifier: "mkOption",
              position: (40, 17),
             },
             arguments: [
              Map {
               bindings: [
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "default",
                    position: (41, 9),
                   },
                  ],
                 },
                 String {
                  parts: [
                   Raw {
                    content: "/run/rethinkdb",
                    position: (41, 20),
                   },
                  ],
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "description",
                    position: (42, 9),
                   },
                  ],
                 },
                 String {
                  parts: [
                   Raw {
                    content: "Location where each instance's pid file is located.",
                    position: (42, 24),
                   },
                  ],
                 },
                ),
               ],
               recursive: false,
               position: (40, 26),
              },
             ],
            },
           ),
          ],
          recursive: false,
          position: (16, 26),
         },
        ),
       ],
       recursive: false,
       position: (14, 13),
      },
     ),
     KeyValue(
      AttributePath {
       attributes: [
        Raw {
         content: "config",
         position: (62, 3),
        },
       ],
      },
      FunctionApplication {
       function: Variable {
        identifier: "mkIf",
        position: (62, 12),
       },
       arguments: [
        PropertyAccess {
         expression: Variable {
          identifier: "config",
          position: (62, 17),
         },
         attribute_path: AttributePath {
          attributes: [
           Raw {
            content: "services",
            position: (62, 24),
           },
           Raw {
            content: "rethinkdb",
            position: (62, 33),
           },
           Raw {
            content: "enable",
            position: (62, 43),
           },
          ],
         },
         default: None,
        },
        Map {
         bindings: [
          KeyValue(
           AttributePath {
            attributes: [
             Raw {
              content: "environment",
              position: (64, 5),
             },
             Raw {
              content: "systemPackages",
              position: (64, 17),
             },
            ],
           },
           List {
            elements: [
             Variable {
              identifier: "rethinkdb",
              position: (64, 36),
             },
            ],
            position: (64, 34),
           },
          ),
          KeyValue(
           AttributePath {
            attributes: [
             Raw {
              content: "systemd",
              position: (66, 5),
             },
             Raw {
              content: "services",
              position: (66, 13),
             },
             Raw {
              content: "rethinkdb",
              position: (66, 22),
             },
            ],
           },
           Map {
            bindings: [
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "description",
                 position: (67, 7),
                },
               ],
              },
              String {
               parts: [
                Raw {
                 content: "RethinkDB server",
                 position: (67, 22),
                },
               ],
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "wantedBy",
                 position: (69, 7),
                },
               ],
              },
              List {
               elements: [
                String {
                 parts: [
                  Raw {
                   content: "multi-user.target",
                   position: (69, 21),
                  },
                 ],
                },
               ],
               position: (69, 18),
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "after",
                 position: (70, 7),
                },
               ],
              },
              List {
               elements: [
                String {
                 parts: [
                  Raw {
                   content: "network.target",
                   position: (70, 18),
                  },
                 ],
                },
               ],
               position: (70, 15),
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "serviceConfig",
                 position: (72, 7),
                },
               ],
              },
              Map {
               bindings: [
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "ExecStart",
                    position: (76, 9),
                   },
                  ],
                 },
                 String {
                  parts: [
                   Expression {
                    expression: Variable {
                     identifier: "rethinkdb",
                     position: (76, 24),
                    },
                   },
                   Raw {
                    content: "/bin/rethinkdb -d ",
                    position: (76, 34),
                   },
                   Expression {
                    expression: PropertyAccess {
                     expression: Variable {
                      identifier: "cfg",
                      position: (76, 54),
                     },
                     attribute_path: AttributePath {
                      attributes: [
                       Raw {
                        content: "dbpath",
                        position: (76, 58),
                       },
                      ],
                     },
                     default: None,
                    },
                   },
                   Raw {
                    content: "/default",
                    position: (76, 65),
                   },
                  ],
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "ExecReload",
                    position: (77, 9),
                   },
                  ],
                 },
                 String {
                  parts: [
                   Expression {
                    expression: PropertyAccess {
                     expression: Variable {
                      identifier: "pkgs",
                      position: (77, 25),
                     },
                     attribute_path: AttributePath {
                      attributes: [
                       Raw {
                        content: "coreutils",
                        position: (77, 30),
                       },
                      ],
                     },
                     default: None,
                    },
                   },
                   Raw {
                    content: "/bin/kill -HUP $MAINPID",
                    position: (77, 40),
                   },
                  ],
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "User",
                    position: (78, 9),
                   },
                  ],
                 },
                 PropertyAccess {
                  expression: Variable {
                   identifier: "cfg",
                   position: (78, 16),
                  },
                  attribute_path: AttributePath {
                   attributes: [
                    Raw {
                     content: "user",
                     position: (78, 20),
                    },
                   ],
                  },
                  default: None,
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "Group",
                    position: (79, 9),
                   },
                  ],
                 },
                 PropertyAccess {
                  expression: Variable {
                   identifier: "cfg",
                   position: (79, 17),
                  },
                  attribute_path: AttributePath {
                   attributes: [
                    Raw {
                     content: "group",
                     position: (79, 21),
                    },
                   ],
                  },
                  default: None,
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "PIDFile",
                    position: (80, 9),
                   },
                  ],
                 },
                 String {
                  parts: [
                   Expression {
                    expression: PropertyAccess {
                     expression: Variable {
                      identifier: "cfg",
                      position: (80, 22),
                     },
                     attribute_path: AttributePath {
                      attributes: [
                       Raw {
                        content: "pidpath",
                        position: (80, 26),
                       },
                      ],
                     },
                     default: None,
                    },
                   },
                   Raw {
                    content: "/default.pid",
                    position: (80, 34),
                   },
                  ],
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "PermissionsStartOnly",
                    position: (81, 9),
                   },
                  ],
                 },
                 Variable {
                  identifier: "true",
                  position: (81, 32),
                 },
                ),
               ],
               recursive: false,
               position: (72, 23),
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "preStart",
                 position: (84, 7),
                },
               ],
              },
              String {
               parts: [
                Raw {
                 content: "if ! test -e ",
                 position: (85, 1),
                },
                Expression {
                 expression: PropertyAccess {
                  expression: Variable {
                   identifier: "cfg",
                   position: (85, 24),
                  },
                  attribute_path: AttributePath {
                   attributes: [
                    Raw {
                     content: "dbpath",
                     position: (85, 28),
                    },
                   ],
                  },
                  default: None,
                 },
                },
                Raw {
                 content: "; then\n    install -d -m0755 -o ",
                 position: (85, 35),
                },
                Expression {
                 expression: PropertyAccess {
                  expression: Variable {
                   identifier: "cfg",
                   position: (86, 36),
                  },
                  attribute_path: AttributePath {
                   attributes: [
                    Raw {
                     content: "user",
                     position: (86, 40),
                    },
                   ],
                  },
                  default: None,
                 },
                },
                Raw {
                 content: " -g ",
                 position: (86, 45),
                },
                Expression {
                 expression: PropertyAccess {
                  expression: Variable {
                   identifier: "cfg",
                   position: (86, 51),
                  },
                  attribute_path: AttributePath {
                   attributes: [
                    Raw {
                     content: "group",
                     position: (86, 55),
                    },
                   ],
                  },
                  default: None,
                 },
                },
                Raw {
                 content: " ",
                 position: (86, 61),
                },
                Expression {
                 expression: PropertyAccess {
                  expression: Variable {
                   identifier: "cfg",
                   position: (86, 64),
                  },
                  attribute_path: AttributePath {
                   attributes: [
                    Raw {
                     content: "dbpath",
                     position: (86, 68),
                    },
                   ],
                  },
                  default: None,
                 },
                },
                Raw {
                 content: "\n    install -d -m0755 -o ",
                 position: (86, 75),
                },
                Expression {
                 expression: PropertyAccess {
                  expression: Variable {
                   identifier: "cfg",
                   position: (87, 36),
                  },
                  attribute_path: AttributePath {
                   attributes: [
                    Raw {
                     content: "user",
                     position: (87, 40),
                    },
                   ],
                  },
                  default: None,
                 },
                },
                Raw {
                 content: " -g ",
                 position: (87, 45),
                },
                Expression {
                 expression: PropertyAccess {
                  expression: Variable {
                   identifier: "cfg",
                   position: (87, 51),
                  },
                  attribute_path: AttributePath {
                   attributes: [
                    Raw {
                     content: "group",
                     position: (87, 55),
                    },
                   ],
                  },
                  default: None,
                 },
                },
                Raw {
                 content: " ",
                 position: (87, 61),
                },
                Expression {
                 expression: PropertyAccess {
                  expression: Variable {
                   identifier: "cfg",
                   position: (87, 64),
                  },
                  attribute_path: AttributePath {
                   attributes: [
                    Raw {
                     content: "dbpath",
                     position: (87, 68),
                    },
                   ],
                  },
                  default: None,
                 },
                },
                Raw {
                 content: "/default\n    chown -R ",
                 position: (87, 75),
                },
                Expression {
                 expression: PropertyAccess {
                  expression: Variable {
                   identifier: "cfg",
                   position: (88, 24),
                  },
                  attribute_path: AttributePath {
                   attributes: [
                    Raw {
                     content: "user",
                     position: (88, 28),
                    },
                   ],
                  },
                  default: None,
                 },
                },
                Raw {
                 content: ":",
                 position: (88, 33),
                },
                Expression {
                 expression: PropertyAccess {
                  expression: Variable {
                   identifier: "cfg",
                   position: (88, 36),
                  },
                  attribute_path: AttributePath {
                   attributes: [
                    Raw {
                     content: "group",
                     position: (88, 40),
                    },
                   ],
                  },
                  default: None,
                 },
                },
                Raw {
                 content: " ",
                 position: (88, 46),
                },
                Expression {
                 expression: PropertyAccess {
                  expression: Variable {
                   identifier: "cfg",
                   position: (88, 49),
                  },
                  attribute_path: AttributePath {
                   attributes: [
                    Raw {
                     content: "dbpath",
                     position: (88, 53),
                    },
                   ],
                  },
                  default: None,
                 },
                },
                Raw {
                 content: "\nfi\nif ! test -e \"",
                 position: (88, 60),
                },
                Expression {
                 expression: PropertyAccess {
                  expression: Variable {
                   identifier: "cfg",
                   position: (90, 25),
                  },
                  attribute_path: AttributePath {
                   attributes: [
                    Raw {
                     content: "pidpath",
                     position: (90, 29),
                    },
                   ],
                  },
                  default: None,
                 },
                },
                Raw {
                 content: "/default.pid\"; then\n    install -D -o ",
                 position: (90, 37),
                },
                Expression {
                 expression: PropertyAccess {
                  expression: Variable {
                   identifier: "cfg",
                   position: (91, 29),
                  },
                  attribute_path: AttributePath {
                   attributes: [
                    Raw {
                     content: "user",
                     position: (91, 33),
                    },
                   ],
                  },
                  default: None,
                 },
                },
                Raw {
                 content: " -g ",
                 position: (91, 38),
                },
                Expression {
                 expression: PropertyAccess {
                  expression: Variable {
                   identifier: "cfg",
                   position: (91, 44),
                  },
                  attribute_path: AttributePath {
                   attributes: [
                    Raw {
                     content: "group",
                     position: (91, 48),
                    },
                   ],
                  },
                  default: None,
                 },
                },
                Raw {
                 content: " /dev/null \"",
                 position: (91, 54),
                },
                Expression {
                 expression: PropertyAccess {
                  expression: Variable {
                   identifier: "cfg",
                   position: (91, 68),
                  },
                  attribute_path: AttributePath {
                   attributes: [
                    Raw {
                     content: "pidpath",
                     position: (91, 72),
                    },
                   ],
                  },
                  default: None,
                 },
                },
                Raw {
                 content: "/default.pid\"\nfi\n",
                 position: (91, 80),
                },
               ],
              },
             ),
            ],
            recursive: false,
            position: (66, 34),
           },
          ),
          KeyValue(
           AttributePath {
            attributes: [
             Raw {
              content: "users",
              position: (96, 5),
             },
             Raw {
              content: "users",
              position: (96, 11),
             },
             Raw {
              content: "rethinkdb",
              position: (96, 17),
             },
            ],
           },
           FunctionApplication {
            function: Variable {
             identifier: "mkIf",
             position: (96, 29),
            },
            arguments: [
             BinaryOperation {
              operator: EqualTo,
              operands: [
               PropertyAccess {
                expression: Variable {
                 identifier: "cfg",
                 position: (96, 35),
                },
                attribute_path: AttributePath {
                 attributes: [
                  Raw {
                   content: "user",
                   position: (96, 39),
                  },
                 ],
                },
                default: None,
               },
               String {
                parts: [
                 Raw {
                  content: "rethinkdb",
                  position: (96, 48),
                 },
                ],
               },
              ],
              position: (96, 44),
             },
             Map {
              bindings: [
               KeyValue(
                AttributePath {
                 attributes: [
                  Raw {
                   content: "name",
                   position: (97, 9),
                  },
                 ],
                },
                String {
                 parts: [
                  Raw {
                   content: "rethinkdb",
                   position: (97, 17),
                  },
                 ],
                },
               ),
               KeyValue(
                AttributePath {
                 attributes: [
                  Raw {
                   content: "description",
                   position: (98, 9),
                  },
                 ],
                },
                String {
                 parts: [
                  Raw {
                   content: "RethinkDB server user",
                   position: (98, 24),
                  },
                 ],
                },
               ),
               KeyValue(
                AttributePath {
                 attributes: [
                  Raw {
                   content: "isSystemUser",
                   position: (99, 9),
                  },
                 ],
                },
                Variable {
                 identifier: "true",
                 position: (99, 24),
                },
               ),
              ],
              recursive: false,
              position: (97, 7),
             },
            ],
           },
          ),
          KeyValue(
           AttributePath {
            attributes: [
             Raw {
              content: "users",
              position: (102, 5),
             },
             Raw {
              content: "groups",
              position: (102, 11),
             },
            ],
           },
           FunctionApplication {
            function: Variable {
             identifier: "optionalAttrs",
             position: (102, 20),
            },
            arguments: [
             BinaryOperation {
              operator: EqualTo,
              operands: [
               PropertyAccess {
                expression: Variable {
                 identifier: "cfg",
                 position: (102, 35),
                },
                attribute_path: AttributePath {
                 attributes: [
                  Raw {
                   content: "group",
                   position: (102, 39),
                  },
                 ],
                },
                default: None,
               },
               String {
                parts: [
                 Raw {
                  content: "rethinkdb",
                  position: (102, 49),
                 },
                ],
               },
              ],
              position: (102, 45),
             },
             FunctionApplication {
              function: Variable {
               identifier: "singleton",
               position: (102, 62),
              },
              arguments: [
               Map {
                bindings: [
                 KeyValue(
                  AttributePath {
                   attributes: [
                    Raw {
                     content: "name",
                     position: (103, 9),
                    },
                   ],
                  },
                  String {
                   parts: [
                    Raw {
                     content: "rethinkdb",
                     position: (103, 17),
                    },
                   ],
                  },
                 ),
                ],
                recursive: false,
                position: (103, 7),
               },
              ],
             },
            ],
           },
          ),
         ],
         recursive: false,
         position: (62, 50),
        },
       ],
      },
     ),
    ],
    recursive: false,
    position: (10, 1),
   },
   position: (5, 1),
  },
  position: (3, 1),
 },
 position: (1, 1),
}