---
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: (4, 3),
      },
     ],
    },
    PropertyAccess {
     expression: Variable {
      identifier: "config",
      position: (4, 9),
     },
     attribute_path: AttributePath {
      attributes: [
       Raw {
        content: "services",
        position: (4, 16),
       },
       Raw {
        content: "metabase",
        position: (4, 25),
       },
      ],
     },
     default: None,
    },
   ),
   Inherit(
    Some(
     Variable {
      identifier: "lib",
      position: (6, 12),
     },
    ),
    [
     Raw {
      content: "mkEnableOption",
      position: (6, 17),
     },
     Raw {
      content: "mkIf",
      position: (6, 32),
     },
     Raw {
      content: "mkOption",
      position: (6, 37),
     },
    ],
   ),
   Inherit(
    Some(
     Variable {
      identifier: "lib",
      position: (7, 12),
     },
    ),
    [
     Raw {
      content: "optional",
      position: (7, 17),
     },
     Raw {
      content: "optionalAttrs",
      position: (7, 26),
     },
     Raw {
      content: "types",
      position: (7, 40),
     },
    ],
   ),
   KeyValue(
    AttributePath {
     attributes: [
      Raw {
       content: "dataDir",
       position: (9, 3),
      },
     ],
    },
    String {
     parts: [
      Raw {
       content: "/var/lib/metabase",
       position: (9, 14),
      },
     ],
    },
   ),
  ],
  target: Map {
   bindings: [
    KeyValue(
     AttributePath {
      attributes: [
       Raw {
        content: "options",
        position: (13, 3),
       },
      ],
     },
     Map {
      bindings: [
       KeyValue(
        AttributePath {
         attributes: [
          Raw {
           content: "services",
           position: (15, 5),
          },
          Raw {
           content: "metabase",
           position: (15, 14),
          },
         ],
        },
        Map {
         bindings: [
          KeyValue(
           AttributePath {
            attributes: [
             Raw {
              content: "enable",
              position: (16, 7),
             },
            ],
           },
           FunctionApplication {
            function: Variable {
             identifier: "mkEnableOption",
             position: (16, 16),
            },
            arguments: [
             String {
              parts: [
               Raw {
                content: "Metabase service",
                position: (16, 32),
               },
              ],
             },
            ],
           },
          ),
          KeyValue(
           AttributePath {
            attributes: [
             Raw {
              content: "listen",
              position: (18, 7),
             },
            ],
           },
           Map {
            bindings: [
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "ip",
                 position: (19, 9),
                },
               ],
              },
              FunctionApplication {
               function: Variable {
                identifier: "mkOption",
                position: (19, 14),
               },
               arguments: [
                Map {
                 bindings: [
                  KeyValue(
                   AttributePath {
                    attributes: [
                     Raw {
                      content: "type",
                      position: (20, 11),
                     },
                    ],
                   },
                   PropertyAccess {
                    expression: Variable {
                     identifier: "types",
                     position: (20, 18),
                    },
                    attribute_path: AttributePath {
                     attributes: [
                      Raw {
                       content: "str",
                       position: (20, 24),
                      },
                     ],
                    },
                    default: None,
                   },
                  ),
                  KeyValue(
                   AttributePath {
                    attributes: [
                     Raw {
                      content: "default",
                      position: (21, 11),
                     },
                    ],
                   },
                   String {
                    parts: [
                     Raw {
                      content: "0.0.0.0",
                      position: (21, 22),
                     },
                    ],
                   },
                  ),
                  KeyValue(
                   AttributePath {
                    attributes: [
                     Raw {
                      content: "description",
                      position: (22, 11),
                     },
                    ],
                   },
                   String {
                    parts: [
                     Raw {
                      content: "IP address that Metabase should listen on.\n",
                      position: (23, 1),
                     },
                    ],
                   },
                  ),
                 ],
                 recursive: false,
                 position: (19, 23),
                },
               ],
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "port",
                 position: (27, 9),
                },
               ],
              },
              FunctionApplication {
               function: Variable {
                identifier: "mkOption",
                position: (27, 16),
               },
               arguments: [
                Map {
                 bindings: [
                  KeyValue(
                   AttributePath {
                    attributes: [
                     Raw {
                      content: "type",
                      position: (28, 11),
                     },
                    ],
                   },
                   PropertyAccess {
                    expression: Variable {
                     identifier: "types",
                     position: (28, 18),
                    },
                    attribute_path: AttributePath {
                     attributes: [
                      Raw {
                       content: "port",
                       position: (28, 24),
                      },
                     ],
                    },
                    default: None,
                   },
                  ),
                  KeyValue(
                   AttributePath {
                    attributes: [
                     Raw {
                      content: "default",
                      position: (29, 11),
                     },
                    ],
                   },
                   Int {
                    value: 3000,
                    position: (29, 21),
                   },
                  ),
                  KeyValue(
                   AttributePath {
                    attributes: [
                     Raw {
                      content: "description",
                      position: (30, 11),
                     },
                    ],
                   },
                   String {
                    parts: [
                     Raw {
                      content: "Listen port for Metabase.\n",
                      position: (31, 1),
                     },
                    ],
                   },
                  ),
                 ],
                 recursive: false,
                 position: (27, 25),
                },
               ],
              },
             ),
            ],
            recursive: false,
            position: (18, 16),
           },
          ),
          KeyValue(
           AttributePath {
            attributes: [
             Raw {
              content: "ssl",
              position: (36, 7),
             },
            ],
           },
           Map {
            bindings: [
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "enable",
                 position: (37, 9),
                },
               ],
              },
              FunctionApplication {
               function: Variable {
                identifier: "mkOption",
                position: (37, 18),
               },
               arguments: [
                Map {
                 bindings: [
                  KeyValue(
                   AttributePath {
                    attributes: [
                     Raw {
                      content: "type",
                      position: (38, 11),
                     },
                    ],
                   },
                   PropertyAccess {
                    expression: Variable {
                     identifier: "types",
                     position: (38, 18),
                    },
                    attribute_path: AttributePath {
                     attributes: [
                      Raw {
                       content: "bool",
                       position: (38, 24),
                      },
                     ],
                    },
                    default: None,
                   },
                  ),
                  KeyValue(
                   AttributePath {
                    attributes: [
                     Raw {
                      content: "default",
                      position: (39, 11),
                     },
                    ],
                   },
                   Variable {
                    identifier: "false",
                    position: (39, 21),
                   },
                  ),
                  KeyValue(
                   AttributePath {
                    attributes: [
                     Raw {
                      content: "description",
                      position: (40, 11),
                     },
                    ],
                   },
                   String {
                    parts: [
                     Raw {
                      content: "Whether to enable SSL (https) support.\n",
                      position: (41, 1),
                     },
                    ],
                   },
                  ),
                 ],
                 recursive: false,
                 position: (37, 27),
                },
               ],
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "port",
                 position: (45, 9),
                },
               ],
              },
              FunctionApplication {
               function: Variable {
                identifier: "mkOption",
                position: (45, 16),
               },
               arguments: [
                Map {
                 bindings: [
                  KeyValue(
                   AttributePath {
                    attributes: [
                     Raw {
                      content: "type",
                      position: (46, 11),
                     },
                    ],
                   },
                   PropertyAccess {
                    expression: Variable {
                     identifier: "types",
                     position: (46, 18),
                    },
                    attribute_path: AttributePath {
                     attributes: [
                      Raw {
                       content: "port",
                       position: (46, 24),
                      },
                     ],
                    },
                    default: None,
                   },
                  ),
                  KeyValue(
                   AttributePath {
                    attributes: [
                     Raw {
                      content: "default",
                      position: (47, 11),
                     },
                    ],
                   },
                   Int {
                    value: 8443,
                    position: (47, 21),
                   },
                  ),
                  KeyValue(
                   AttributePath {
                    attributes: [
                     Raw {
                      content: "description",
                      position: (48, 11),
                     },
                    ],
                   },
                   String {
                    parts: [
                     Raw {
                      content: "Listen port over SSL (https) for Metabase.\n",
                      position: (49, 1),
                     },
                    ],
                   },
                  ),
                 ],
                 recursive: false,
                 position: (45, 25),
                },
               ],
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "keystore",
                 position: (53, 9),
                },
               ],
              },
              FunctionApplication {
               function: Variable {
                identifier: "mkOption",
                position: (53, 20),
               },
               arguments: [
                Map {
                 bindings: [
                  KeyValue(
                   AttributePath {
                    attributes: [
                     Raw {
                      content: "type",
                      position: (54, 11),
                     },
                    ],
                   },
                   FunctionApplication {
                    function: PropertyAccess {
                     expression: Variable {
                      identifier: "types",
                      position: (54, 18),
                     },
                     attribute_path: AttributePath {
                      attributes: [
                       Raw {
                        content: "nullOr",
                        position: (54, 24),
                       },
                      ],
                     },
                     default: None,
                    },
                    arguments: [
                     PropertyAccess {
                      expression: Variable {
                       identifier: "types",
                       position: (54, 31),
                      },
                      attribute_path: AttributePath {
                       attributes: [
                        Raw {
                         content: "path",
                         position: (54, 37),
                        },
                       ],
                      },
                      default: None,
                     },
                    ],
                   },
                  ),
                  KeyValue(
                   AttributePath {
                    attributes: [
                     Raw {
                      content: "default",
                      position: (55, 11),
                     },
                    ],
                   },
                   String {
                    parts: [
                     Expression {
                      expression: Variable {
                       identifier: "dataDir",
                       position: (55, 24),
                      },
                     },
                     Raw {
                      content: "/metabase.jks",
                      position: (55, 32),
                     },
                    ],
                   },
                  ),
                  KeyValue(
                   AttributePath {
                    attributes: [
                     Raw {
                      content: "example",
                      position: (56, 11),
                     },
                    ],
                   },
                   String {
                    parts: [
                     Raw {
                      content: "/etc/secrets/keystore.jks",
                      position: (56, 22),
                     },
                    ],
                   },
                  ),
                  KeyValue(
                   AttributePath {
                    attributes: [
                     Raw {
                      content: "description",
                      position: (57, 11),
                     },
                    ],
                   },
                   String {
                    parts: [
                     Raw {
                      content: "<link xlink:href=\"https://www.digitalocean.com/community/tutorials/java-keytool-essentials-working-with-java-keystores\">Java KeyStore</link> file containing the certificates.\n",
                      position: (58, 1),
                     },
                    ],
                   },
                  ),
                 ],
                 recursive: false,
                 position: (53, 29),
                },
               ],
              },
             ),
            ],
            recursive: false,
            position: (36, 13),
           },
          ),
          KeyValue(
           AttributePath {
            attributes: [
             Raw {
              content: "openFirewall",
              position: (64, 7),
             },
            ],
           },
           FunctionApplication {
            function: Variable {
             identifier: "mkOption",
             position: (64, 22),
            },
            arguments: [
             Map {
              bindings: [
               KeyValue(
                AttributePath {
                 attributes: [
                  Raw {
                   content: "type",
                   position: (65, 9),
                  },
                 ],
                },
                PropertyAccess {
                 expression: Variable {
                  identifier: "types",
                  position: (65, 16),
                 },
                 attribute_path: AttributePath {
                  attributes: [
                   Raw {
                    content: "bool",
                    position: (65, 22),
                   },
                  ],
                 },
                 default: None,
                },
               ),
               KeyValue(
                AttributePath {
                 attributes: [
                  Raw {
                   content: "default",
                   position: (66, 9),
                  },
                 ],
                },
                Variable {
                 identifier: "false",
                 position: (66, 19),
                },
               ),
               KeyValue(
                AttributePath {
                 attributes: [
                  Raw {
                   content: "description",
                   position: (67, 9),
                  },
                 ],
                },
                String {
                 parts: [
                  Raw {
                   content: "Open ports in the firewall for Metabase.\n",
                   position: (68, 1),
                  },
                 ],
                },
               ),
              ],
              recursive: false,
              position: (64, 31),
             },
            ],
           },
          ),
         ],
         recursive: false,
         position: (15, 25),
        },
       ),
      ],
      recursive: false,
      position: (13, 13),
     },
    ),
    KeyValue(
     AttributePath {
      attributes: [
       Raw {
        content: "config",
        position: (75, 3),
       },
      ],
     },
     FunctionApplication {
      function: Variable {
       identifier: "mkIf",
       position: (75, 12),
      },
      arguments: [
       PropertyAccess {
        expression: Variable {
         identifier: "cfg",
         position: (75, 17),
        },
        attribute_path: AttributePath {
         attributes: [
          Raw {
           content: "enable",
           position: (75, 21),
          },
         ],
        },
        default: None,
       },
       Map {
        bindings: [
         KeyValue(
          AttributePath {
           attributes: [
            Raw {
             content: "systemd",
             position: (77, 5),
            },
            Raw {
             content: "services",
             position: (77, 13),
            },
            Raw {
             content: "metabase",
             position: (77, 22),
            },
           ],
          },
          Map {
           bindings: [
            KeyValue(
             AttributePath {
              attributes: [
               Raw {
                content: "description",
                position: (78, 7),
               },
              ],
             },
             String {
              parts: [
               Raw {
                content: "Metabase server",
                position: (78, 22),
               },
              ],
             },
            ),
            KeyValue(
             AttributePath {
              attributes: [
               Raw {
                content: "wantedBy",
                position: (79, 7),
               },
              ],
             },
             List {
              elements: [
               String {
                parts: [
                 Raw {
                  content: "multi-user.target",
                  position: (79, 21),
                 },
                ],
               },
              ],
              position: (79, 18),
             },
            ),
            KeyValue(
             AttributePath {
              attributes: [
               Raw {
                content: "after",
                position: (80, 7),
               },
              ],
             },
             List {
              elements: [
               String {
                parts: [
                 Raw {
                  content: "network-online.target",
                  position: (80, 18),
                 },
                ],
               },
              ],
              position: (80, 15),
             },
            ),
            KeyValue(
             AttributePath {
              attributes: [
               Raw {
                content: "environment",
                position: (81, 7),
               },
              ],
             },
             BinaryOperation {
              operator: Update,
              operands: [
               Map {
                bindings: [
                 KeyValue(
                  AttributePath {
                   attributes: [
                    Raw {
                     content: "MB_PLUGINS_DIR",
                     position: (82, 9),
                    },
                   ],
                  },
                  String {
                   parts: [
                    Expression {
                     expression: Variable {
                      identifier: "dataDir",
                      position: (82, 29),
                     },
                    },
                    Raw {
                     content: "/plugins",
                     position: (82, 37),
                    },
                   ],
                  },
                 ),
                 KeyValue(
                  AttributePath {
                   attributes: [
                    Raw {
                     content: "MB_DB_FILE",
                     position: (83, 9),
                    },
                   ],
                  },
                  String {
                   parts: [
                    Expression {
                     expression: Variable {
                      identifier: "dataDir",
                      position: (83, 25),
                     },
                    },
                    Raw {
                     content: "/metabase.db",
                     position: (83, 33),
                    },
                   ],
                  },
                 ),
                 KeyValue(
                  AttributePath {
                   attributes: [
                    Raw {
                     content: "MB_JETTY_HOST",
                     position: (84, 9),
                    },
                   ],
                  },
                  PropertyAccess {
                   expression: Variable {
                    identifier: "cfg",
                    position: (84, 25),
                   },
                   attribute_path: AttributePath {
                    attributes: [
                     Raw {
                      content: "listen",
                      position: (84, 29),
                     },
                     Raw {
                      content: "ip",
                      position: (84, 36),
                     },
                    ],
                   },
                   default: None,
                  },
                 ),
                 KeyValue(
                  AttributePath {
                   attributes: [
                    Raw {
                     content: "MB_JETTY_PORT",
                     position: (85, 9),
                    },
                   ],
                  },
                  FunctionApplication {
                   function: Variable {
                    identifier: "toString",
                    position: (85, 25),
                   },
                   arguments: [
                    PropertyAccess {
                     expression: Variable {
                      identifier: "cfg",
                      position: (85, 34),
                     },
                     attribute_path: AttributePath {
                      attributes: [
                       Raw {
                        content: "listen",
                        position: (85, 38),
                       },
                       Raw {
                        content: "port",
                        position: (85, 45),
                       },
                      ],
                     },
                     default: None,
                    },
                   ],
                  },
                 ),
                ],
                recursive: false,
                position: (81, 21),
               },
               FunctionApplication {
                function: Variable {
                 identifier: "optionalAttrs",
                 position: (86, 12),
                },
                arguments: [
                 PropertyAccess {
                  expression: Variable {
                   identifier: "cfg",
                   position: (86, 27),
                  },
                  attribute_path: AttributePath {
                   attributes: [
                    Raw {
                     content: "ssl",
                     position: (86, 31),
                    },
                    Raw {
                     content: "enable",
                     position: (86, 35),
                    },
                   ],
                  },
                  default: None,
                 },
                 Map {
                  bindings: [
                   KeyValue(
                    AttributePath {
                     attributes: [
                      Raw {
                       content: "MB_JETTY_SSL",
                       position: (87, 9),
                      },
                     ],
                    },
                    Variable {
                     identifier: "true",
                     position: (87, 24),
                    },
                   ),
                   KeyValue(
                    AttributePath {
                     attributes: [
                      Raw {
                       content: "MB_JETTY_SSL_PORT",
                       position: (88, 9),
                      },
                     ],
                    },
                    FunctionApplication {
                     function: Variable {
                      identifier: "toString",
                      position: (88, 29),
                     },
                     arguments: [
                      PropertyAccess {
                       expression: Variable {
                        identifier: "cfg",
                        position: (88, 38),
                       },
                       attribute_path: AttributePath {
                        attributes: [
                         Raw {
                          content: "ssl",
                          position: (88, 42),
                         },
                         Raw {
                          content: "port",
                          position: (88, 46),
                         },
                        ],
                       },
                       default: None,
                      },
                     ],
                    },
                   ),
                   KeyValue(
                    AttributePath {
                     attributes: [
                      Raw {
                       content: "MB_JETTY_SSL_KEYSTORE",
                       position: (89, 9),
                      },
                     ],
                    },
                    PropertyAccess {
                     expression: Variable {
                      identifier: "cfg",
                      position: (89, 33),
                     },
                     attribute_path: AttributePath {
                      attributes: [
                       Raw {
                        content: "ssl",
                        position: (89, 37),
                       },
                       Raw {
                        content: "keystore",
                        position: (89, 41),
                       },
                      ],
                     },
                     default: None,
                    },
                   ),
                  ],
                  recursive: false,
                  position: (86, 43),
                 },
                ],
               },
              ],
              position: (86, 9),
             },
            ),
            KeyValue(
             AttributePath {
              attributes: [
               Raw {
                content: "serviceConfig",
                position: (91, 7),
               },
              ],
             },
             Map {
              bindings: [
               KeyValue(
                AttributePath {
                 attributes: [
                  Raw {
                   content: "DynamicUser",
                   position: (92, 9),
                  },
                 ],
                },
                Variable {
                 identifier: "true",
                 position: (92, 23),
                },
               ),
               KeyValue(
                AttributePath {
                 attributes: [
                  Raw {
                   content: "StateDirectory",
                   position: (93, 9),
                  },
                 ],
                },
                FunctionApplication {
                 function: Variable {
                  identifier: "baseNameOf",
                  position: (93, 26),
                 },
                 arguments: [
                  Variable {
                   identifier: "dataDir",
                   position: (93, 37),
                  },
                 ],
                },
               ),
               KeyValue(
                AttributePath {
                 attributes: [
                  Raw {
                   content: "ExecStart",
                   position: (94, 9),
                  },
                 ],
                },
                String {
                 parts: [
                  Expression {
                   expression: PropertyAccess {
                    expression: Variable {
                     identifier: "pkgs",
                     position: (94, 24),
                    },
                    attribute_path: AttributePath {
                     attributes: [
                      Raw {
                       content: "metabase",
                       position: (94, 29),
                      },
                     ],
                    },
                    default: None,
                   },
                  },
                  Raw {
                   content: "/bin/metabase",
                   position: (94, 38),
                  },
                 ],
                },
               ),
              ],
              recursive: false,
              position: (91, 23),
             },
            ),
           ],
           recursive: false,
           position: (77, 33),
          },
         ),
         KeyValue(
          AttributePath {
           attributes: [
            Raw {
             content: "networking",
             position: (98, 5),
            },
            Raw {
             content: "firewall",
             position: (98, 16),
            },
           ],
          },
          FunctionApplication {
           function: Variable {
            identifier: "mkIf",
            position: (98, 27),
           },
           arguments: [
            PropertyAccess {
             expression: Variable {
              identifier: "cfg",
              position: (98, 32),
             },
             attribute_path: AttributePath {
              attributes: [
               Raw {
                content: "openFirewall",
                position: (98, 36),
               },
              ],
             },
             default: None,
            },
            Map {
             bindings: [
              KeyValue(
               AttributePath {
                attributes: [
                 Raw {
                  content: "allowedTCPPorts",
                  position: (99, 7),
                 },
                ],
               },
               BinaryOperation {
                operator: Concatenation,
                operands: [
                 List {
                  elements: [
                   PropertyAccess {
                    expression: Variable {
                     identifier: "cfg",
                     position: (99, 27),
                    },
                    attribute_path: AttributePath {
                     attributes: [
                      Raw {
                       content: "listen",
                       position: (99, 31),
                      },
                      Raw {
                       content: "port",
                       position: (99, 38),
                      },
                     ],
                    },
                    default: None,
                   },
                  ],
                  position: (99, 25),
                 },
                 FunctionApplication {
                  function: Variable {
                   identifier: "optional",
                   position: (99, 48),
                  },
                  arguments: [
                   PropertyAccess {
                    expression: Variable {
                     identifier: "cfg",
                     position: (99, 57),
                    },
                    attribute_path: AttributePath {
                     attributes: [
                      Raw {
                       content: "ssl",
                       position: (99, 61),
                      },
                      Raw {
                       content: "enable",
                       position: (99, 65),
                      },
                     ],
                    },
                    default: None,
                   },
                   PropertyAccess {
                    expression: Variable {
                     identifier: "cfg",
                     position: (99, 72),
                    },
                    attribute_path: AttributePath {
                     attributes: [
                      Raw {
                       content: "ssl",
                       position: (99, 76),
                      },
                      Raw {
                       content: "port",
                       position: (99, 80),
                      },
                     ],
                    },
                    default: None,
                   },
                  ],
                 },
                ],
                position: (99, 45),
               },
              ),
             ],
             recursive: false,
             position: (98, 49),
            },
           ],
          },
         ),
        ],
        recursive: false,
        position: (75, 28),
       },
      ],
     },
    ),
   ],
   recursive: false,
   position: (11, 4),
  },
  position: (3, 1),
 },
 position: (1, 1),
}