---
Function {
 argument: None,
 arguments: FunctionArguments {
  arguments: [
   FunctionArgument {
    identifier: "pkgs",
    default: None,
   },
   FunctionArgument {
    identifier: "lib",
    default: None,
   },
   FunctionArgument {
    identifier: "config",
    default: None,
   },
  ],
  ellipsis: true,
 },
 definition: With {
  expression: Variable {
   identifier: "lib",
   position: (3, 6),
  },
  target: LetIn {
   bindings: [
    KeyValue(
     AttributePath {
      attributes: [
       Raw {
        content: "cfg",
        position: (5, 3),
       },
      ],
     },
     PropertyAccess {
      expression: Variable {
       identifier: "config",
       position: (5, 9),
      },
      attribute_path: AttributePath {
       attributes: [
        Raw {
         content: "services",
         position: (5, 16),
        },
        Raw {
         content: "dkimproxy-out",
         position: (5, 25),
        },
       ],
      },
      default: None,
     },
    ),
    KeyValue(
     AttributePath {
      attributes: [
       Raw {
        content: "keydir",
        position: (6, 3),
       },
      ],
     },
     String {
      parts: [
       Raw {
        content: "/var/lib/dkimproxy-out",
        position: (6, 13),
       },
      ],
     },
    ),
    KeyValue(
     AttributePath {
      attributes: [
       Raw {
        content: "privkey",
        position: (7, 3),
       },
      ],
     },
     String {
      parts: [
       Expression {
        expression: Variable {
         identifier: "keydir",
         position: (7, 16),
        },
       },
       Raw {
        content: "/private.key",
        position: (7, 23),
       },
      ],
     },
    ),
    KeyValue(
     AttributePath {
      attributes: [
       Raw {
        content: "pubkey",
        position: (8, 3),
       },
      ],
     },
     String {
      parts: [
       Expression {
        expression: Variable {
         identifier: "keydir",
         position: (8, 15),
        },
       },
       Raw {
        content: "/public.key",
        position: (8, 22),
       },
      ],
     },
    ),
   ],
   target: Map {
    bindings: [
     KeyValue(
      AttributePath {
       attributes: [
        Raw {
         content: "options",
         position: (12, 3),
        },
       ],
      },
      Map {
       bindings: [
        KeyValue(
         AttributePath {
          attributes: [
           Raw {
            content: "services",
            position: (13, 5),
           },
           Raw {
            content: "dkimproxy-out",
            position: (13, 14),
           },
          ],
         },
         Map {
          bindings: [
           KeyValue(
            AttributePath {
             attributes: [
              Raw {
               content: "enable",
               position: (14, 7),
              },
             ],
            },
            FunctionApplication {
             function: Variable {
              identifier: "mkOption",
              position: (14, 16),
             },
             arguments: [
              Map {
               bindings: [
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "type",
                    position: (15, 9),
                   },
                  ],
                 },
                 PropertyAccess {
                  expression: Variable {
                   identifier: "types",
                   position: (15, 16),
                  },
                  attribute_path: AttributePath {
                   attributes: [
                    Raw {
                     content: "bool",
                     position: (15, 22),
                    },
                   ],
                  },
                  default: None,
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "default",
                    position: (16, 9),
                   },
                  ],
                 },
                 Variable {
                  identifier: "false",
                  position: (16, 19),
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "description",
                    position: (17, 9),
                   },
                  ],
                 },
                 String {
                  parts: [
                   Raw {
                    content: "Whether to enable dkimproxy_out.\n\nNote that a key will be auto-generated, and can be found in\n",
                    position: (19, 1),
                   },
                   Expression {
                    expression: Variable {
                     identifier: "keydir",
                     position: (22, 15),
                    },
                   },
                   Raw {
                    content: ".\n",
                    position: (22, 22),
                   },
                  ],
                 },
                ),
               ],
               recursive: false,
               position: (14, 25),
              },
             ],
            },
           ),
           KeyValue(
            AttributePath {
             attributes: [
              Raw {
               content: "listen",
               position: (26, 7),
              },
             ],
            },
            FunctionApplication {
             function: Variable {
              identifier: "mkOption",
              position: (26, 16),
             },
             arguments: [
              Map {
               bindings: [
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "type",
                    position: (27, 9),
                   },
                  ],
                 },
                 PropertyAccess {
                  expression: Variable {
                   identifier: "types",
                   position: (27, 16),
                  },
                  attribute_path: AttributePath {
                   attributes: [
                    Raw {
                     content: "str",
                     position: (27, 22),
                    },
                   ],
                  },
                  default: None,
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "example",
                    position: (28, 9),
                   },
                  ],
                 },
                 String {
                  parts: [
                   Raw {
                    content: "127.0.0.1:10027",
                    position: (28, 20),
                   },
                  ],
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "description",
                    position: (29, 9),
                   },
                  ],
                 },
                 String {
                  parts: [
                   Raw {
                    content: "Address:port DKIMproxy should listen on.",
                    position: (29, 24),
                   },
                  ],
                 },
                ),
               ],
               recursive: false,
               position: (26, 25),
              },
             ],
            },
           ),
           KeyValue(
            AttributePath {
             attributes: [
              Raw {
               content: "relay",
               position: (32, 7),
              },
             ],
            },
            FunctionApplication {
             function: Variable {
              identifier: "mkOption",
              position: (32, 15),
             },
             arguments: [
              Map {
               bindings: [
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "type",
                    position: (33, 9),
                   },
                  ],
                 },
                 PropertyAccess {
                  expression: Variable {
                   identifier: "types",
                   position: (33, 16),
                  },
                  attribute_path: AttributePath {
                   attributes: [
                    Raw {
                     content: "str",
                     position: (33, 22),
                    },
                   ],
                  },
                  default: None,
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "example",
                    position: (34, 9),
                   },
                  ],
                 },
                 String {
                  parts: [
                   Raw {
                    content: "127.0.0.1:10028",
                    position: (34, 20),
                   },
                  ],
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "description",
                    position: (35, 9),
                   },
                  ],
                 },
                 String {
                  parts: [
                   Raw {
                    content: "Address:port DKIMproxy should forward mail to.",
                    position: (35, 24),
                   },
                  ],
                 },
                ),
               ],
               recursive: false,
               position: (32, 24),
              },
             ],
            },
           ),
           KeyValue(
            AttributePath {
             attributes: [
              Raw {
               content: "domains",
               position: (38, 7),
              },
             ],
            },
            FunctionApplication {
             function: Variable {
              identifier: "mkOption",
              position: (38, 17),
             },
             arguments: [
              Map {
               bindings: [
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "type",
                    position: (39, 9),
                   },
                  ],
                 },
                 With {
                  expression: Variable {
                   identifier: "types",
                   position: (39, 21),
                  },
                  target: FunctionApplication {
                   function: Variable {
                    identifier: "listOf",
                    position: (39, 28),
                   },
                   arguments: [
                    Variable {
                     identifier: "str",
                     position: (39, 35),
                    },
                   ],
                  },
                  position: (39, 16),
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "example",
                    position: (40, 9),
                   },
                  ],
                 },
                 List {
                  elements: [
                   String {
                    parts: [
                     Raw {
                      content: "example.org",
                      position: (40, 22),
                     },
                    ],
                   },
                   String {
                    parts: [
                     Raw {
                      content: "example.com",
                      position: (40, 36),
                     },
                    ],
                   },
                  ],
                  position: (40, 19),
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "description",
                    position: (41, 9),
                   },
                  ],
                 },
                 String {
                  parts: [
                   Raw {
                    content: "List of domains DKIMproxy can sign for.",
                    position: (41, 24),
                   },
                  ],
                 },
                ),
               ],
               recursive: false,
               position: (38, 26),
              },
             ],
            },
           ),
           KeyValue(
            AttributePath {
             attributes: [
              Raw {
               content: "selector",
               position: (44, 7),
              },
             ],
            },
            FunctionApplication {
             function: Variable {
              identifier: "mkOption",
              position: (44, 18),
             },
             arguments: [
              Map {
               bindings: [
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "type",
                    position: (45, 9),
                   },
                  ],
                 },
                 PropertyAccess {
                  expression: Variable {
                   identifier: "types",
                   position: (45, 16),
                  },
                  attribute_path: AttributePath {
                   attributes: [
                    Raw {
                     content: "str",
                     position: (45, 22),
                    },
                   ],
                  },
                  default: None,
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "example",
                    position: (46, 9),
                   },
                  ],
                 },
                 String {
                  parts: [
                   Raw {
                    content: "selector1",
                    position: (46, 20),
                   },
                  ],
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "description",
                    position: (47, 9),
                   },
                  ],
                 },
                 String {
                  parts: [
                   Raw {
                    content: "The selector to use for DKIM key identification.\n\nFor example, if 'selector1' is used here, then for each domain\n'example.org' given in `domain`, 'selector1._domainkey.example.org'\nshould contain the TXT record indicating the public key is the one\nin ",
                    position: (49, 1),
                   },
                   Expression {
                    expression: Variable {
                     identifier: "pubkey",
                     position: (54, 18),
                    },
                   },
                   Raw {
                    content: ": \"v=DKIM1; t=s; p=[THE PUBLIC KEY]\".\n",
                    position: (54, 25),
                   },
                  ],
                 },
                ),
               ],
               recursive: false,
               position: (44, 27),
              },
             ],
            },
           ),
           KeyValue(
            AttributePath {
             attributes: [
              Raw {
               content: "keySize",
               position: (58, 7),
              },
             ],
            },
            FunctionApplication {
             function: Variable {
              identifier: "mkOption",
              position: (58, 17),
             },
             arguments: [
              Map {
               bindings: [
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "type",
                    position: (59, 9),
                   },
                  ],
                 },
                 PropertyAccess {
                  expression: Variable {
                   identifier: "types",
                   position: (59, 16),
                  },
                  attribute_path: AttributePath {
                   attributes: [
                    Raw {
                     content: "int",
                     position: (59, 22),
                    },
                   ],
                  },
                  default: None,
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "default",
                    position: (60, 9),
                   },
                  ],
                 },
                 Int {
                  value: 2048,
                  position: (60, 19),
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "description",
                    position: (61, 9),
                   },
                  ],
                 },
                 String {
                  parts: [
                   Raw {
                    content: "Size of the RSA key to use to sign outgoing emails. Note that the\nmaximum mandatorily verified as per RFC6376 is 2048.\n",
                    position: (63, 1),
                   },
                  ],
                 },
                ),
               ],
               recursive: false,
               position: (58, 26),
              },
             ],
            },
           ),
          ],
          recursive: false,
          position: (13, 30),
         },
        ),
       ],
       recursive: false,
       position: (12, 13),
      },
     ),
     KeyValue(
      AttributePath {
       attributes: [
        Raw {
         content: "config",
         position: (75, 3),
        },
       ],
      },
      LetIn {
       bindings: [
        KeyValue(
         AttributePath {
          attributes: [
           Raw {
            content: "configfile",
            position: (76, 5),
           },
          ],
         },
         FunctionApplication {
          function: PropertyAccess {
           expression: Variable {
            identifier: "pkgs",
            position: (76, 18),
           },
           attribute_path: AttributePath {
            attributes: [
             Raw {
              content: "writeText",
              position: (76, 23),
             },
            ],
           },
           default: None,
          },
          arguments: [
           String {
            parts: [
             Raw {
              content: "dkimproxy_out.conf",
              position: (76, 34),
             },
            ],
           },
           String {
            parts: [
             Raw {
              content: "listen ",
              position: (78, 1),
             },
             Expression {
              expression: PropertyAccess {
               expression: Variable {
                identifier: "cfg",
                position: (78, 18),
               },
               attribute_path: AttributePath {
                attributes: [
                 Raw {
                  content: "listen",
                  position: (78, 22),
                 },
                ],
               },
               default: None,
              },
             },
             Raw {
              content: "\nrelay ",
              position: (78, 29),
             },
             Expression {
              expression: PropertyAccess {
               expression: Variable {
                identifier: "cfg",
                position: (79, 17),
               },
               attribute_path: AttributePath {
                attributes: [
                 Raw {
                  content: "relay",
                  position: (79, 21),
                 },
                ],
               },
               default: None,
              },
             },
             Raw {
              content: "\n\ndomain ",
              position: (79, 27),
             },
             Expression {
              expression: FunctionApplication {
               function: Variable {
                identifier: "concatStringsSep",
                position: (81, 18),
               },
               arguments: [
                String {
                 parts: [
                  Raw {
                   content: ",",
                   position: (81, 36),
                  },
                 ],
                },
                PropertyAccess {
                 expression: Variable {
                  identifier: "cfg",
                  position: (81, 39),
                 },
                 attribute_path: AttributePath {
                  attributes: [
                   Raw {
                    content: "domains",
                    position: (81, 43),
                   },
                  ],
                 },
                 default: None,
                },
               ],
              },
             },
             Raw {
              content: "\nselector ",
              position: (81, 51),
             },
             Expression {
              expression: PropertyAccess {
               expression: Variable {
                identifier: "cfg",
                position: (82, 20),
               },
               attribute_path: AttributePath {
                attributes: [
                 Raw {
                  content: "selector",
                  position: (82, 24),
                 },
                ],
               },
               default: None,
              },
             },
             Raw {
              content: "\n\nsignature dkim(c=relaxed/relaxed)\n\nkeyfile ",
              position: (82, 33),
             },
             Expression {
              expression: Variable {
               identifier: "privkey",
               position: (86, 19),
              },
             },
             Raw {
              content: "\n",
              position: (86, 27),
             },
            ],
           },
          ],
         },
        ),
       ],
       target: FunctionApplication {
        function: Variable {
         identifier: "mkIf",
         position: (89, 5),
        },
        arguments: [
         PropertyAccess {
          expression: Variable {
           identifier: "cfg",
           position: (89, 10),
          },
          attribute_path: AttributePath {
           attributes: [
            Raw {
             content: "enable",
             position: (89, 14),
            },
           ],
          },
          default: None,
         },
         Map {
          bindings: [
           KeyValue(
            AttributePath {
             attributes: [
              Raw {
               content: "users",
               position: (90, 7),
              },
              Raw {
               content: "groups",
               position: (90, 13),
              },
              Raw {
               content: "dkimproxy-out",
               position: (90, 20),
              },
             ],
            },
            Map {
             bindings: [],
             recursive: false,
             position: (90, 36),
            },
           ),
           KeyValue(
            AttributePath {
             attributes: [
              Raw {
               content: "users",
               position: (91, 7),
              },
              Raw {
               content: "users",
               position: (91, 13),
              },
              Raw {
               content: "dkimproxy-out",
               position: (91, 19),
              },
             ],
            },
            Map {
             bindings: [
              KeyValue(
               AttributePath {
                attributes: [
                 Raw {
                  content: "description",
                  position: (92, 9),
                 },
                ],
               },
               String {
                parts: [
                 Raw {
                  content: "DKIMproxy_out daemon",
                  position: (92, 24),
                 },
                ],
               },
              ),
              KeyValue(
               AttributePath {
                attributes: [
                 Raw {
                  content: "group",
                  position: (93, 9),
                 },
                ],
               },
               String {
                parts: [
                 Raw {
                  content: "dkimproxy-out",
                  position: (93, 18),
                 },
                ],
               },
              ),
              KeyValue(
               AttributePath {
                attributes: [
                 Raw {
                  content: "isSystemUser",
                  position: (94, 9),
                 },
                ],
               },
               Variable {
                identifier: "true",
                position: (94, 24),
               },
              ),
             ],
             recursive: false,
             position: (91, 35),
            },
           ),
           KeyValue(
            AttributePath {
             attributes: [
              Raw {
               content: "systemd",
               position: (97, 7),
              },
              Raw {
               content: "services",
               position: (97, 15),
              },
              Raw {
               content: "dkimproxy-out",
               position: (97, 24),
              },
             ],
            },
            Map {
             bindings: [
              KeyValue(
               AttributePath {
                attributes: [
                 Raw {
                  content: "description",
                  position: (98, 9),
                 },
                ],
               },
               String {
                parts: [
                 Raw {
                  content: "DKIMproxy_out",
                  position: (98, 24),
                 },
                ],
               },
              ),
              KeyValue(
               AttributePath {
                attributes: [
                 Raw {
                  content: "wantedBy",
                  position: (99, 9),
                 },
                ],
               },
               List {
                elements: [
                 String {
                  parts: [
                   Raw {
                    content: "multi-user.target",
                    position: (99, 23),
                   },
                  ],
                 },
                ],
                position: (99, 20),
               },
              ),
              KeyValue(
               AttributePath {
                attributes: [
                 Raw {
                  content: "preStart",
                  position: (100, 9),
                 },
                ],
               },
               String {
                parts: [
                 Raw {
                  content: "if [ ! -d \"",
                  position: (101, 1),
                 },
                 Expression {
                  expression: Variable {
                   identifier: "keydir",
                   position: (101, 24),
                  },
                 },
                 Raw {
                  content: "\" ]; then\n  mkdir -p \"",
                  position: (101, 31),
                 },
                 Expression {
                  expression: Variable {
                   identifier: "keydir",
                   position: (102, 25),
                  },
                 },
                 Raw {
                  content: "\"\n  chmod 0700 \"",
                  position: (102, 32),
                 },
                 Expression {
                  expression: Variable {
                   identifier: "keydir",
                   position: (103, 27),
                  },
                 },
                 Raw {
                  content: "\"\n  ",
                  position: (103, 34),
                 },
                 Expression {
                  expression: PropertyAccess {
                   expression: Variable {
                    identifier: "pkgs",
                    position: (104, 15),
                   },
                   attribute_path: AttributePath {
                    attributes: [
                     Raw {
                      content: "openssl",
                      position: (104, 20),
                     },
                    ],
                   },
                   default: None,
                  },
                 },
                 Raw {
                  content: "/bin/openssl genrsa -out \"",
                  position: (104, 28),
                 },
                 Expression {
                  expression: Variable {
                   identifier: "privkey",
                   position: (104, 56),
                  },
                 },
                 Raw {
                  content: "\" ",
                  position: (104, 64),
                 },
                 Expression {
                  expression: FunctionApplication {
                   function: Variable {
                    identifier: "toString",
                    position: (104, 68),
                   },
                   arguments: [
                    PropertyAccess {
                     expression: Variable {
                      identifier: "cfg",
                      position: (104, 77),
                     },
                     attribute_path: AttributePath {
                      attributes: [
                       Raw {
                        content: "keySize",
                        position: (104, 81),
                       },
                      ],
                     },
                     default: None,
                    },
                   ],
                  },
                 },
                 Raw {
                  content: "\n  ",
                  position: (104, 89),
                 },
                 Expression {
                  expression: PropertyAccess {
                   expression: Variable {
                    identifier: "pkgs",
                    position: (105, 15),
                   },
                   attribute_path: AttributePath {
                    attributes: [
                     Raw {
                      content: "openssl",
                      position: (105, 20),
                     },
                    ],
                   },
                   default: None,
                  },
                 },
                 Raw {
                  content: "/bin/openssl rsa -in \"",
                  position: (105, 28),
                 },
                 Expression {
                  expression: Variable {
                   identifier: "privkey",
                   position: (105, 52),
                  },
                 },
                 Raw {
                  content: "\" -pubout -out \"",
                  position: (105, 60),
                 },
                 Expression {
                  expression: Variable {
                   identifier: "pubkey",
                   position: (105, 78),
                  },
                 },
                 Raw {
                  content: "\"\n  chown -R dkimproxy-out:dkimproxy-out \"",
                  position: (105, 85),
                 },
                 Expression {
                  expression: Variable {
                   identifier: "keydir",
                   position: (106, 53),
                  },
                 },
                 Raw {
                  content: "\"\nfi\n",
                  position: (106, 60),
                 },
                ],
               },
              ),
              KeyValue(
               AttributePath {
                attributes: [
                 Raw {
                  content: "script",
                  position: (109, 9),
                 },
                ],
               },
               String {
                parts: [
                 Raw {
                  content: "exec ",
                  position: (110, 1),
                 },
                 Expression {
                  expression: PropertyAccess {
                   expression: Variable {
                    identifier: "pkgs",
                    position: (110, 18),
                   },
                   attribute_path: AttributePath {
                    attributes: [
                     Raw {
                      content: "dkimproxy",
                      position: (110, 23),
                     },
                    ],
                   },
                   default: None,
                  },
                 },
                 Raw {
                  content: "/bin/dkimproxy.out --conf_file=",
                  position: (110, 33),
                 },
                 Expression {
                  expression: Variable {
                   identifier: "configfile",
                   position: (110, 66),
                  },
                 },
                 Raw {
                  content: "\n",
                  position: (110, 77),
                 },
                ],
               },
              ),
              KeyValue(
               AttributePath {
                attributes: [
                 Raw {
                  content: "serviceConfig",
                  position: (112, 9),
                 },
                ],
               },
               Map {
                bindings: [
                 KeyValue(
                  AttributePath {
                   attributes: [
                    Raw {
                     content: "User",
                     position: (113, 11),
                    },
                   ],
                  },
                  String {
                   parts: [
                    Raw {
                     content: "dkimproxy-out",
                     position: (113, 19),
                    },
                   ],
                  },
                 ),
                 KeyValue(
                  AttributePath {
                   attributes: [
                    Raw {
                     content: "PermissionsStartOnly",
                     position: (114, 11),
                    },
                   ],
                  },
                  Variable {
                   identifier: "true",
                   position: (114, 34),
                  },
                 ),
                ],
                recursive: false,
                position: (112, 25),
               },
              ),
             ],
             recursive: false,
             position: (97, 40),
            },
           ),
          ],
          recursive: false,
          position: (89, 21),
         },
        ],
       },
       position: (75, 12),
      },
     ),
     KeyValue(
      AttributePath {
       attributes: [
        Raw {
         content: "meta",
         position: (119, 3),
        },
        Raw {
         content: "maintainers",
         position: (119, 8),
        },
       ],
      },
      With {
       expression: PropertyAccess {
        expression: Variable {
         identifier: "lib",
         position: (119, 27),
        },
        attribute_path: AttributePath {
         attributes: [
          Raw {
           content: "maintainers",
           position: (119, 31),
          },
         ],
        },
        default: None,
       },
       target: List {
        elements: [
         Variable {
          identifier: "ekleog",
          position: (119, 46),
         },
        ],
        position: (119, 44),
       },
       position: (119, 22),
      },
     ),
    ],
    recursive: false,
    position: (10, 1),
   },
   position: (4, 1),
  },
  position: (3, 1),
 },
 position: (1, 1),
}