---
Function {
 argument: None,
 arguments: FunctionArguments {
  arguments: [
   FunctionArgument {
    identifier: "pkgs",
    default: None,
   },
   FunctionArgument {
    identifier: "lib",
    default: None,
   },
   FunctionArgument {
    identifier: "config",
    default: None,
   },
  ],
  ellipsis: true,
 },
 definition: LetIn {
  bindings: [
   KeyValue(
    AttributePath {
     attributes: [
      Raw {
       content: "cfg",
       position: (3, 3),
      },
     ],
    },
    PropertyAccess {
     expression: Variable {
      identifier: "config",
      position: (3, 9),
     },
     attribute_path: AttributePath {
      attributes: [
       Raw {
        content: "services",
        position: (3, 16),
       },
       Raw {
        content: "clickhouse",
        position: (3, 25),
       },
      ],
     },
     default: None,
    },
   ),
  ],
  target: With {
   expression: Variable {
    identifier: "lib",
    position: (5, 6),
   },
   target: Map {
    bindings: [
     KeyValue(
      AttributePath {
       attributes: [
        Raw {
         content: "options",
         position: (10, 3),
        },
       ],
      },
      Map {
       bindings: [
        KeyValue(
         AttributePath {
          attributes: [
           Raw {
            content: "services",
            position: (12, 5),
           },
           Raw {
            content: "clickhouse",
            position: (12, 14),
           },
          ],
         },
         Map {
          bindings: [
           KeyValue(
            AttributePath {
             attributes: [
              Raw {
               content: "enable",
               position: (14, 7),
              },
             ],
            },
            FunctionApplication {
             function: Variable {
              identifier: "mkEnableOption",
              position: (14, 16),
             },
             arguments: [
              String {
               parts: [
                Raw {
                 content: "ClickHouse database server",
                 position: (14, 32),
                },
               ],
              },
             ],
            },
           ),
           KeyValue(
            AttributePath {
             attributes: [
              Raw {
               content: "package",
               position: (16, 7),
              },
             ],
            },
            FunctionApplication {
             function: Variable {
              identifier: "mkOption",
              position: (16, 17),
             },
             arguments: [
              Map {
               bindings: [
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "type",
                    position: (17, 9),
                   },
                  ],
                 },
                 PropertyAccess {
                  expression: Variable {
                   identifier: "types",
                   position: (17, 16),
                  },
                  attribute_path: AttributePath {
                   attributes: [
                    Raw {
                     content: "package",
                     position: (17, 22),
                    },
                   ],
                  },
                  default: None,
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "default",
                    position: (18, 9),
                   },
                  ],
                 },
                 PropertyAccess {
                  expression: Variable {
                   identifier: "pkgs",
                   position: (18, 19),
                  },
                  attribute_path: AttributePath {
                   attributes: [
                    Raw {
                     content: "clickhouse",
                     position: (18, 24),
                    },
                   ],
                  },
                  default: None,
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "defaultText",
                    position: (19, 9),
                   },
                  ],
                 },
                 String {
                  parts: [
                   Raw {
                    content: "pkgs.clickhouse",
                    position: (19, 24),
                   },
                  ],
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "description",
                    position: (20, 9),
                   },
                  ],
                 },
                 String {
                  parts: [
                   Raw {
                    content: "ClickHouse package to use.\n",
                    position: (21, 1),
                   },
                  ],
                 },
                ),
               ],
               recursive: false,
               position: (16, 26),
              },
             ],
            },
           ),
          ],
          recursive: false,
          position: (12, 27),
         },
        ),
       ],
       recursive: false,
       position: (10, 13),
      },
     ),
     KeyValue(
      AttributePath {
       attributes: [
        Raw {
         content: "config",
         position: (32, 3),
        },
       ],
      },
      FunctionApplication {
       function: Variable {
        identifier: "mkIf",
        position: (32, 12),
       },
       arguments: [
        PropertyAccess {
         expression: Variable {
          identifier: "cfg",
          position: (32, 17),
         },
         attribute_path: AttributePath {
          attributes: [
           Raw {
            content: "enable",
            position: (32, 21),
           },
          ],
         },
         default: None,
        },
        Map {
         bindings: [
          KeyValue(
           AttributePath {
            attributes: [
             Raw {
              content: "users",
              position: (34, 5),
             },
             Raw {
              content: "users",
              position: (34, 11),
             },
             Raw {
              content: "clickhouse",
              position: (34, 17),
             },
            ],
           },
           Map {
            bindings: [
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "name",
                 position: (35, 7),
                },
               ],
              },
              String {
               parts: [
                Raw {
                 content: "clickhouse",
                 position: (35, 15),
                },
               ],
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "uid",
                 position: (36, 7),
                },
               ],
              },
              PropertyAccess {
               expression: Variable {
                identifier: "config",
                position: (36, 13),
               },
               attribute_path: AttributePath {
                attributes: [
                 Raw {
                  content: "ids",
                  position: (36, 20),
                 },
                 Raw {
                  content: "uids",
                  position: (36, 24),
                 },
                 Raw {
                  content: "clickhouse",
                  position: (36, 29),
                 },
                ],
               },
               default: None,
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "group",
                 position: (37, 7),
                },
               ],
              },
              String {
               parts: [
                Raw {
                 content: "clickhouse",
                 position: (37, 16),
                },
               ],
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "description",
                 position: (38, 7),
                },
               ],
              },
              String {
               parts: [
                Raw {
                 content: "ClickHouse server user",
                 position: (38, 22),
                },
               ],
              },
             ),
            ],
            recursive: false,
            position: (34, 30),
           },
          ),
          KeyValue(
           AttributePath {
            attributes: [
             Raw {
              content: "users",
              position: (41, 5),
             },
             Raw {
              content: "groups",
              position: (41, 11),
             },
             Raw {
              content: "clickhouse",
              position: (41, 18),
             },
             Raw {
              content: "gid",
              position: (41, 29),
             },
            ],
           },
           PropertyAccess {
            expression: Variable {
             identifier: "config",
             position: (41, 35),
            },
            attribute_path: AttributePath {
             attributes: [
              Raw {
               content: "ids",
               position: (41, 42),
              },
              Raw {
               content: "gids",
               position: (41, 46),
              },
              Raw {
               content: "clickhouse",
               position: (41, 51),
              },
             ],
            },
            default: None,
           },
          ),
          KeyValue(
           AttributePath {
            attributes: [
             Raw {
              content: "systemd",
              position: (43, 5),
             },
             Raw {
              content: "services",
              position: (43, 13),
             },
             Raw {
              content: "clickhouse",
              position: (43, 22),
             },
            ],
           },
           Map {
            bindings: [
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "description",
                 position: (44, 7),
                },
               ],
              },
              String {
               parts: [
                Raw {
                 content: "ClickHouse server",
                 position: (44, 22),
                },
               ],
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "wantedBy",
                 position: (46, 7),
                },
               ],
              },
              List {
               elements: [
                String {
                 parts: [
                  Raw {
                   content: "multi-user.target",
                   position: (46, 21),
                  },
                 ],
                },
               ],
               position: (46, 18),
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "after",
                 position: (48, 7),
                },
               ],
              },
              List {
               elements: [
                String {
                 parts: [
                  Raw {
                   content: "network.target",
                   position: (48, 18),
                  },
                 ],
                },
               ],
               position: (48, 15),
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "serviceConfig",
                 position: (50, 7),
                },
               ],
              },
              Map {
               bindings: [
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "User",
                    position: (51, 9),
                   },
                  ],
                 },
                 String {
                  parts: [
                   Raw {
                    content: "clickhouse",
                    position: (51, 17),
                   },
                  ],
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "Group",
                    position: (52, 9),
                   },
                  ],
                 },
                 String {
                  parts: [
                   Raw {
                    content: "clickhouse",
                    position: (52, 18),
                   },
                  ],
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "ConfigurationDirectory",
                    position: (53, 9),
                   },
                  ],
                 },
                 String {
                  parts: [
                   Raw {
                    content: "clickhouse-server",
                    position: (53, 35),
                   },
                  ],
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "AmbientCapabilities",
                    position: (54, 9),
                   },
                  ],
                 },
                 String {
                  parts: [
                   Raw {
                    content: "CAP_SYS_NICE",
                    position: (54, 32),
                   },
                  ],
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "StateDirectory",
                    position: (55, 9),
                   },
                  ],
                 },
                 String {
                  parts: [
                   Raw {
                    content: "clickhouse",
                    position: (55, 27),
                   },
                  ],
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "LogsDirectory",
                    position: (56, 9),
                   },
                  ],
                 },
                 String {
                  parts: [
                   Raw {
                    content: "clickhouse",
                    position: (56, 26),
                   },
                  ],
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "ExecStart",
                    position: (57, 9),
                   },
                  ],
                 },
                 String {
                  parts: [
                   Expression {
                    expression: PropertyAccess {
                     expression: Variable {
                      identifier: "cfg",
                      position: (57, 24),
                     },
                     attribute_path: AttributePath {
                      attributes: [
                       Raw {
                        content: "package",
                        position: (57, 28),
                       },
                      ],
                     },
                     default: None,
                    },
                   },
                   Raw {
                    content: "/bin/clickhouse-server --config-file=",
                    position: (57, 36),
                   },
                   Expression {
                    expression: PropertyAccess {
                     expression: Variable {
                      identifier: "cfg",
                      position: (57, 75),
                     },
                     attribute_path: AttributePath {
                      attributes: [
                       Raw {
                        content: "package",
                        position: (57, 79),
                       },
                      ],
                     },
                     default: None,
                    },
                   },
                   Raw {
                    content: "/etc/clickhouse-server/config.xml",
                    position: (57, 87),
                   },
                  ],
                 },
                ),
               ],
               recursive: false,
               position: (50, 23),
              },
             ),
            ],
            recursive: false,
            position: (43, 35),
           },
          ),
          KeyValue(
           AttributePath {
            attributes: [
             Raw {
              content: "environment",
              position: (61, 5),
             },
             Raw {
              content: "etc",
              position: (61, 17),
             },
            ],
           },
           Map {
            bindings: [
             KeyValue(
              AttributePath {
               attributes: [
                Expression {
                 expression: String {
                  parts: [
                   Raw {
                    content: "clickhouse-server/config.xml",
                    position: (62, 8),
                   },
                  ],
                 },
                },
               ],
              },
              Map {
               bindings: [
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "source",
                    position: (63, 9),
                   },
                  ],
                 },
                 String {
                  parts: [
                   Expression {
                    expression: PropertyAccess {
                     expression: Variable {
                      identifier: "cfg",
                      position: (63, 21),
                     },
                     attribute_path: AttributePath {
                      attributes: [
                       Raw {
                        content: "package",
                        position: (63, 25),
                       },
                      ],
                     },
                     default: None,
                    },
                   },
                   Raw {
                    content: "/etc/clickhouse-server/config.xml",
                    position: (63, 33),
                   },
                  ],
                 },
                ),
               ],
               recursive: false,
               position: (62, 40),
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Expression {
                 expression: String {
                  parts: [
                   Raw {
                    content: "clickhouse-server/users.xml",
                    position: (66, 8),
                   },
                  ],
                 },
                },
               ],
              },
              Map {
               bindings: [
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "source",
                    position: (67, 9),
                   },
                  ],
                 },
                 String {
                  parts: [
                   Expression {
                    expression: PropertyAccess {
                     expression: Variable {
                      identifier: "cfg",
                      position: (67, 21),
                     },
                     attribute_path: AttributePath {
                      attributes: [
                       Raw {
                        content: "package",
                        position: (67, 25),
                       },
                      ],
                     },
                     default: None,
                    },
                   },
                   Raw {
                    content: "/etc/clickhouse-server/users.xml",
                    position: (67, 33),
                   },
                  ],
                 },
                ),
               ],
               recursive: false,
               position: (66, 39),
              },
             ),
            ],
            recursive: false,
            position: (61, 23),
           },
          ),
          KeyValue(
           AttributePath {
            attributes: [
             Raw {
              content: "environment",
              position: (71, 5),
             },
             Raw {
              content: "systemPackages",
              position: (71, 17),
             },
            ],
           },
           List {
            elements: [
             PropertyAccess {
              expression: Variable {
               identifier: "cfg",
               position: (71, 36),
              },
              attribute_path: AttributePath {
               attributes: [
                Raw {
                 content: "package",
                 position: (71, 40),
                },
               ],
              },
              default: None,
             },
            ],
            position: (71, 34),
           },
          ),
          KeyValue(
           AttributePath {
            attributes: [
             Raw {
              content: "time",
              position: (74, 5),
             },
             Raw {
              content: "timeZone",
              position: (74, 10),
             },
            ],
           },
           FunctionApplication {
            function: Variable {
             identifier: "mkDefault",
             position: (74, 21),
            },
            arguments: [
             String {
              parts: [
               Raw {
                content: "UTC",
                position: (74, 32),
               },
              ],
             },
            ],
           },
          ),
         ],
         recursive: false,
         position: (32, 28),
        },
       ],
      },
     ),
    ],
    recursive: false,
    position: (6, 1),
   },
   position: (5, 1),
  },
  position: (2, 1),
 },
 position: (1, 1),
}