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