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