---
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: "signald",
         position: (5, 25),
        },
       ],
      },
      default: None,
     },
    ),
    KeyValue(
     AttributePath {
      attributes: [
       Raw {
        content: "dataDir",
        position: (6, 3),
       },
      ],
     },
     String {
      parts: [
       Raw {
        content: "/var/lib/signald",
        position: (6, 14),
       },
      ],
     },
    ),
    KeyValue(
     AttributePath {
      attributes: [
       Raw {
        content: "defaultUser",
        position: (7, 3),
       },
      ],
     },
     String {
      parts: [
       Raw {
        content: "signald",
        position: (7, 18),
       },
      ],
     },
    ),
   ],
   target: Map {
    bindings: [
     KeyValue(
      AttributePath {
       attributes: [
        Raw {
         content: "options",
         position: (10, 3),
        },
        Raw {
         content: "services",
         position: (10, 11),
        },
        Raw {
         content: "signald",
         position: (10, 20),
        },
       ],
      },
      Map {
       bindings: [
        KeyValue(
         AttributePath {
          attributes: [
           Raw {
            content: "enable",
            position: (11, 5),
           },
          ],
         },
         FunctionApplication {
          function: Variable {
           identifier: "mkEnableOption",
           position: (11, 14),
          },
          arguments: [
           String {
            parts: [
             Raw {
              content: "the signald service",
              position: (11, 30),
             },
            ],
           },
          ],
         },
        ),
        KeyValue(
         AttributePath {
          attributes: [
           Raw {
            content: "user",
            position: (13, 5),
           },
          ],
         },
         FunctionApplication {
          function: Variable {
           identifier: "mkOption",
           position: (13, 12),
          },
          arguments: [
           Map {
            bindings: [
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "type",
                 position: (14, 7),
                },
               ],
              },
              PropertyAccess {
               expression: Variable {
                identifier: "types",
                position: (14, 14),
               },
               attribute_path: AttributePath {
                attributes: [
                 Raw {
                  content: "str",
                  position: (14, 20),
                 },
                ],
               },
               default: None,
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "default",
                 position: (15, 7),
                },
               ],
              },
              Variable {
               identifier: "defaultUser",
               position: (15, 17),
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "description",
                 position: (16, 7),
                },
               ],
              },
              String {
               parts: [
                Raw {
                 content: "User under which signald runs.",
                 position: (16, 22),
                },
               ],
              },
             ),
            ],
            recursive: false,
            position: (13, 21),
           },
          ],
         },
        ),
        KeyValue(
         AttributePath {
          attributes: [
           Raw {
            content: "group",
            position: (19, 5),
           },
          ],
         },
         FunctionApplication {
          function: Variable {
           identifier: "mkOption",
           position: (19, 13),
          },
          arguments: [
           Map {
            bindings: [
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "type",
                 position: (20, 7),
                },
               ],
              },
              PropertyAccess {
               expression: Variable {
                identifier: "types",
                position: (20, 14),
               },
               attribute_path: AttributePath {
                attributes: [
                 Raw {
                  content: "str",
                  position: (20, 20),
                 },
                ],
               },
               default: None,
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "default",
                 position: (21, 7),
                },
               ],
              },
              Variable {
               identifier: "defaultUser",
               position: (21, 17),
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "description",
                 position: (22, 7),
                },
               ],
              },
              String {
               parts: [
                Raw {
                 content: "Group under which signald runs.",
                 position: (22, 22),
                },
               ],
              },
             ),
            ],
            recursive: false,
            position: (19, 22),
           },
          ],
         },
        ),
        KeyValue(
         AttributePath {
          attributes: [
           Raw {
            content: "socketPath",
            position: (25, 5),
           },
          ],
         },
         FunctionApplication {
          function: Variable {
           identifier: "mkOption",
           position: (25, 18),
          },
          arguments: [
           Map {
            bindings: [
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "type",
                 position: (26, 7),
                },
               ],
              },
              PropertyAccess {
               expression: Variable {
                identifier: "types",
                position: (26, 14),
               },
               attribute_path: AttributePath {
                attributes: [
                 Raw {
                  content: "str",
                  position: (26, 20),
                 },
                ],
               },
               default: None,
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "default",
                 position: (27, 7),
                },
               ],
              },
              String {
               parts: [
                Raw {
                 content: "/run/signald/signald.sock",
                 position: (27, 18),
                },
               ],
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "description",
                 position: (28, 7),
                },
               ],
              },
              String {
               parts: [
                Raw {
                 content: "Path to the signald socket",
                 position: (28, 22),
                },
               ],
              },
             ),
            ],
            recursive: false,
            position: (25, 27),
           },
          ],
         },
        ),
       ],
       recursive: false,
       position: (10, 30),
      },
     ),
     KeyValue(
      AttributePath {
       attributes: [
        Raw {
         content: "config",
         position: (32, 3),
        },
       ],
      },
      FunctionApplication {
       function: Variable {
        identifier: "mkIf",
        position: (32, 12),
       },
       arguments: [
        PropertyAccess {
         expression: Variable {
          identifier: "cfg",
          position: (32, 17),
         },
         attribute_path: AttributePath {
          attributes: [
           Raw {
            content: "enable",
            position: (32, 21),
           },
          ],
         },
         default: None,
        },
        Map {
         bindings: [
          KeyValue(
           AttributePath {
            attributes: [
             Raw {
              content: "users",
              position: (33, 5),
             },
             Raw {
              content: "users",
              position: (33, 11),
             },
            ],
           },
           FunctionApplication {
            function: Variable {
             identifier: "optionalAttrs",
             position: (33, 19),
            },
            arguments: [
             BinaryOperation {
              operator: EqualTo,
              operands: [
               PropertyAccess {
                expression: Variable {
                 identifier: "cfg",
                 position: (33, 34),
                },
                attribute_path: AttributePath {
                 attributes: [
                  Raw {
                   content: "user",
                   position: (33, 38),
                  },
                 ],
                },
                default: None,
               },
               Variable {
                identifier: "defaultUser",
                position: (33, 46),
               },
              ],
              position: (33, 43),
             },
             Map {
              bindings: [
               KeyValue(
                AttributePath {
                 attributes: [
                  Expression {
                   expression: Variable {
                    identifier: "defaultUser",
                    position: (34, 9),
                   },
                  },
                 ],
                },
                Map {
                 bindings: [
                  KeyValue(
                   AttributePath {
                    attributes: [
                     Raw {
                      content: "group",
                      position: (35, 9),
                     },
                    ],
                   },
                   PropertyAccess {
                    expression: Variable {
                     identifier: "cfg",
                     position: (35, 17),
                    },
                    attribute_path: AttributePath {
                     attributes: [
                      Raw {
                       content: "group",
                       position: (35, 21),
                      },
                     ],
                    },
                    default: None,
                   },
                  ),
                  KeyValue(
                   AttributePath {
                    attributes: [
                     Raw {
                      content: "isSystemUser",
                      position: (36, 9),
                     },
                    ],
                   },
                   Variable {
                    identifier: "true",
                    position: (36, 24),
                   },
                  ),
                 ],
                 recursive: false,
                 position: (34, 24),
                },
               ),
              ],
              recursive: false,
              position: (33, 59),
             },
            ],
           },
          ),
          KeyValue(
           AttributePath {
            attributes: [
             Raw {
              content: "users",
              position: (40, 5),
             },
             Raw {
              content: "groups",
              position: (40, 11),
             },
            ],
           },
           FunctionApplication {
            function: Variable {
             identifier: "optionalAttrs",
             position: (40, 20),
            },
            arguments: [
             BinaryOperation {
              operator: EqualTo,
              operands: [
               PropertyAccess {
                expression: Variable {
                 identifier: "cfg",
                 position: (40, 35),
                },
                attribute_path: AttributePath {
                 attributes: [
                  Raw {
                   content: "group",
                   position: (40, 39),
                  },
                 ],
                },
                default: None,
               },
               Variable {
                identifier: "defaultUser",
                position: (40, 48),
               },
              ],
              position: (40, 45),
             },
             Map {
              bindings: [
               KeyValue(
                AttributePath {
                 attributes: [
                  Expression {
                   expression: Variable {
                    identifier: "defaultUser",
                    position: (41, 9),
                   },
                  },
                 ],
                },
                Map {
                 bindings: [],
                 recursive: false,
                 position: (41, 24),
                },
               ),
              ],
              recursive: false,
              position: (40, 61),
             },
            ],
           },
          ),
          KeyValue(
           AttributePath {
            attributes: [
             Raw {
              content: "systemd",
              position: (44, 5),
             },
             Raw {
              content: "services",
              position: (44, 13),
             },
             Raw {
              content: "signald",
              position: (44, 22),
             },
            ],
           },
           Map {
            bindings: [
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "description",
                 position: (45, 7),
                },
               ],
              },
              String {
               parts: [
                Raw {
                 content: "A daemon for interacting with the Signal Private Messenger",
                 position: (45, 22),
                },
               ],
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "wants",
                 position: (46, 7),
                },
               ],
              },
              List {
               elements: [
                String {
                 parts: [
                  Raw {
                   content: "network.target",
                   position: (46, 18),
                  },
                 ],
                },
               ],
               position: (46, 15),
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "wantedBy",
                 position: (47, 7),
                },
               ],
              },
              List {
               elements: [
                String {
                 parts: [
                  Raw {
                   content: "multi-user.target",
                   position: (47, 21),
                  },
                 ],
                },
               ],
               position: (47, 18),
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "after",
                 position: (48, 7),
                },
               ],
              },
              List {
               elements: [
                String {
                 parts: [
                  Raw {
                   content: "network.target",
                   position: (48, 18),
                  },
                 ],
                },
               ],
               position: (48, 15),
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "serviceConfig",
                 position: (50, 7),
                },
               ],
              },
              Map {
               bindings: [
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "User",
                    position: (51, 9),
                   },
                  ],
                 },
                 PropertyAccess {
                  expression: Variable {
                   identifier: "cfg",
                   position: (51, 16),
                  },
                  attribute_path: AttributePath {
                   attributes: [
                    Raw {
                     content: "user",
                     position: (51, 20),
                    },
                   ],
                  },
                  default: None,
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "Group",
                    position: (52, 9),
                   },
                  ],
                 },
                 PropertyAccess {
                  expression: Variable {
                   identifier: "cfg",
                   position: (52, 17),
                  },
                  attribute_path: AttributePath {
                   attributes: [
                    Raw {
                     content: "group",
                     position: (52, 21),
                    },
                   ],
                  },
                  default: None,
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "ExecStart",
                    position: (53, 9),
                   },
                  ],
                 },
                 String {
                  parts: [
                   Expression {
                    expression: PropertyAccess {
                     expression: Variable {
                      identifier: "pkgs",
                      position: (53, 24),
                     },
                     attribute_path: AttributePath {
                      attributes: [
                       Raw {
                        content: "signald",
                        position: (53, 29),
                       },
                      ],
                     },
                     default: None,
                    },
                   },
                   Raw {
                    content: "/bin/signald -d ",
                    position: (53, 37),
                   },
                   Expression {
                    expression: Variable {
                     identifier: "dataDir",
                     position: (53, 55),
                    },
                   },
                   Raw {
                    content: " -s ",
                    position: (53, 63),
                   },
                   Expression {
                    expression: PropertyAccess {
                     expression: Variable {
                      identifier: "cfg",
                      position: (53, 69),
                     },
                     attribute_path: AttributePath {
                      attributes: [
                       Raw {
                        content: "socketPath",
                        position: (53, 73),
                       },
                      ],
                     },
                     default: None,
                    },
                   },
                  ],
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "Restart",
                    position: (54, 9),
                   },
                  ],
                 },
                 String {
                  parts: [
                   Raw {
                    content: "on-failure",
                    position: (54, 20),
                   },
                  ],
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "StateDirectory",
                    position: (55, 9),
                   },
                  ],
                 },
                 String {
                  parts: [
                   Raw {
                    content: "signald",
                    position: (55, 27),
                   },
                  ],
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "RuntimeDirectory",
                    position: (56, 9),
                   },
                  ],
                 },
                 String {
                  parts: [
                   Raw {
                    content: "signald",
                    position: (56, 29),
                   },
                  ],
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "StateDirectoryMode",
                    position: (57, 9),
                   },
                  ],
                 },
                 String {
                  parts: [
                   Raw {
                    content: "0750",
                    position: (57, 31),
                   },
                  ],
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "RuntimeDirectoryMode",
                    position: (58, 9),
                   },
                  ],
                 },
                 String {
                  parts: [
                   Raw {
                    content: "0750",
                    position: (58, 33),
                   },
                  ],
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "BindReadOnlyPaths",
                    position: (60, 9),
                   },
                  ],
                 },
                 List {
                  elements: [
                   String {
                    parts: [
                     Raw {
                      content: "/nix/store",
                      position: (61, 12),
                     },
                    ],
                   },
                   String {
                    parts: [
                     Raw {
                      content: "-/etc/resolv.conf",
                      position: (62, 12),
                     },
                    ],
                   },
                   String {
                    parts: [
                     Raw {
                      content: "-/etc/nsswitch.conf",
                      position: (63, 12),
                     },
                    ],
                   },
                   String {
                    parts: [
                     Raw {
                      content: "-/etc/hosts",
                      position: (64, 12),
                     },
                    ],
                   },
                   String {
                    parts: [
                     Raw {
                      content: "-/etc/localtime",
                      position: (65, 12),
                     },
                    ],
                   },
                  ],
                  position: (60, 29),
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "CapabilityBoundingSet",
                    position: (67, 9),
                   },
                  ],
                 },
                 String {
                  parts: [],
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "DeviceAllow",
                    position: (69, 9),
                   },
                  ],
                 },
                 String {
                  parts: [],
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "LockPersonality",
                    position: (72, 9),
                   },
                  ],
                 },
                 Variable {
                  identifier: "true",
                  position: (72, 27),
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "NoNewPrivileges",
                    position: (75, 9),
                   },
                  ],
                 },
                 Variable {
                  identifier: "true",
                  position: (75, 27),
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "PrivateDevices",
                    position: (76, 9),
                   },
                  ],
                 },
                 Variable {
                  identifier: "true",
                  position: (76, 26),
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "PrivateMounts",
                    position: (77, 9),
                   },
                  ],
                 },
                 Variable {
                  identifier: "true",
                  position: (77, 25),
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "PrivateTmp",
                    position: (80, 9),
                   },
                  ],
                 },
                 Variable {
                  identifier: "true",
                  position: (80, 22),
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "PrivateUsers",
                    position: (81, 9),
                   },
                  ],
                 },
                 Variable {
                  identifier: "true",
                  position: (81, 24),
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "ProcSubset",
                    position: (82, 9),
                   },
                  ],
                 },
                 String {
                  parts: [
                   Raw {
                    content: "pid",
                    position: (82, 23),
                   },
                  ],
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "ProtectClock",
                    position: (83, 9),
                   },
                  ],
                 },
                 Variable {
                  identifier: "true",
                  position: (83, 24),
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "ProtectHome",
                    position: (84, 9),
                   },
                  ],
                 },
                 Variable {
                  identifier: "true",
                  position: (84, 23),
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "ProtectHostname",
                    position: (85, 9),
                   },
                  ],
                 },
                 Variable {
                  identifier: "true",
                  position: (85, 27),
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "ProtectControlGroups",
                    position: (88, 9),
                   },
                  ],
                 },
                 Variable {
                  identifier: "true",
                  position: (88, 32),
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "ProtectKernelLogs",
                    position: (89, 9),
                   },
                  ],
                 },
                 Variable {
                  identifier: "true",
                  position: (89, 29),
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "ProtectKernelModules",
                    position: (90, 9),
                   },
                  ],
                 },
                 Variable {
                  identifier: "true",
                  position: (90, 32),
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "ProtectKernelTunables",
                    position: (91, 9),
                   },
                  ],
                 },
                 Variable {
                  identifier: "true",
                  position: (91, 33),
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "ProtectProc",
                    position: (92, 9),
                   },
                  ],
                 },
                 String {
                  parts: [
                   Raw {
                    content: "invisible",
                    position: (92, 24),
                   },
                  ],
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "RestrictAddressFamilies",
                    position: (93, 9),
                   },
                  ],
                 },
                 List {
                  elements: [
                   String {
                    parts: [
                     Raw {
                      content: "AF_INET",
                      position: (93, 38),
                     },
                    ],
                   },
                   String {
                    parts: [
                     Raw {
                      content: "AF_INET6",
                      position: (93, 48),
                     },
                    ],
                   },
                   String {
                    parts: [
                     Raw {
                      content: "AF_UNIX",
                      position: (93, 59),
                     },
                    ],
                   },
                  ],
                  position: (93, 35),
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "RestrictNamespaces",
                    position: (94, 9),
                   },
                  ],
                 },
                 Variable {
                  identifier: "true",
                  position: (94, 30),
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "RestrictRealtime",
                    position: (95, 9),
                   },
                  ],
                 },
                 Variable {
                  identifier: "true",
                  position: (95, 28),
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "RestrictSUIDSGID",
                    position: (96, 9),
                   },
                  ],
                 },
                 Variable {
                  identifier: "true",
                  position: (96, 28),
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "SystemCallArchitectures",
                    position: (97, 9),
                   },
                  ],
                 },
                 String {
                  parts: [
                   Raw {
                    content: "native",
                    position: (97, 36),
                   },
                  ],
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "SystemCallFilter",
                    position: (98, 9),
                   },
                  ],
                 },
                 List {
                  elements: [
                   String {
                    parts: [
                     Raw {
                      content: "@system-service",
                      position: (98, 31),
                     },
                    ],
                   },
                   String {
                    parts: [
                     Raw {
                      content: "~@privileged @resources @setuid @keyring",
                      position: (98, 49),
                     },
                    ],
                   },
                  ],
                  position: (98, 28),
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "TemporaryFileSystem",
                    position: (99, 9),
                   },
                  ],
                 },
                 String {
                  parts: [
                   Raw {
                    content: "/:ro",
                    position: (99, 32),
                   },
                  ],
                 },
                ),
               ],
               recursive: false,
               position: (50, 23),
              },
             ),
            ],
            recursive: false,
            position: (44, 32),
           },
          ),
         ],
         recursive: false,
         position: (32, 28),
        },
       ],
      },
     ),
    ],
    recursive: false,
    position: (9, 1),
   },
   position: (4, 1),
  },
  position: (3, 1),
 },
 position: (1, 1),
}