---
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: (2, 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: "environment",
         position: (5, 16),
        },
        Raw {
         content: "memoryAllocator",
         position: (5, 28),
        },
       ],
      },
      default: None,
     },
    ),
    KeyValue(
     AttributePath {
      attributes: [
       Raw {
        content: "providers",
        position: (8, 3),
       },
      ],
     },
     Map {
      bindings: [
       KeyValue(
        AttributePath {
         attributes: [
          Raw {
           content: "graphene-hardened",
           position: (9, 5),
          },
         ],
        },
        Map {
         bindings: [
          KeyValue(
           AttributePath {
            attributes: [
             Raw {
              content: "libPath",
              position: (10, 7),
             },
            ],
           },
           String {
            parts: [
             Expression {
              expression: PropertyAccess {
               expression: Variable {
                identifier: "pkgs",
                position: (10, 20),
               },
               attribute_path: AttributePath {
                attributes: [
                 Raw {
                  content: "graphene-hardened-malloc",
                  position: (10, 25),
                 },
                ],
               },
               default: None,
              },
             },
             Raw {
              content: "/lib/libhardened_malloc.so",
              position: (10, 50),
             },
            ],
           },
          ),
          KeyValue(
           AttributePath {
            attributes: [
             Raw {
              content: "description",
              position: (11, 7),
             },
            ],
           },
           String {
            parts: [
             Raw {
              content: "An allocator designed to mitigate memory corruption attacks, such as\nthose caused by use-after-free bugs.\n",
              position: (12, 1),
             },
            ],
           },
          ),
         ],
         recursive: false,
         position: (9, 25),
        },
       ),
       KeyValue(
        AttributePath {
         attributes: [
          Raw {
           content: "jemalloc",
           position: (17, 5),
          },
         ],
        },
        Map {
         bindings: [
          KeyValue(
           AttributePath {
            attributes: [
             Raw {
              content: "libPath",
              position: (18, 7),
             },
            ],
           },
           String {
            parts: [
             Expression {
              expression: PropertyAccess {
               expression: Variable {
                identifier: "pkgs",
                position: (18, 20),
               },
               attribute_path: AttributePath {
                attributes: [
                 Raw {
                  content: "jemalloc",
                  position: (18, 25),
                 },
                ],
               },
               default: None,
              },
             },
             Raw {
              content: "/lib/libjemalloc.so",
              position: (18, 34),
             },
            ],
           },
          ),
          KeyValue(
           AttributePath {
            attributes: [
             Raw {
              content: "description",
              position: (19, 7),
             },
            ],
           },
           String {
            parts: [
             Raw {
              content: "A general purpose allocator that emphasizes fragmentation avoidance\nand scalable concurrency support.\n",
              position: (20, 1),
             },
            ],
           },
          ),
         ],
         recursive: false,
         position: (17, 16),
        },
       ),
       KeyValue(
        AttributePath {
         attributes: [
          Raw {
           content: "scudo",
           position: (25, 5),
          },
         ],
        },
        LetIn {
         bindings: [
          KeyValue(
           AttributePath {
            attributes: [
             Raw {
              content: "platformMap",
              position: (26, 7),
             },
            ],
           },
           Map {
            bindings: [
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "aarch64-linux",
                 position: (27, 9),
                },
               ],
              },
              String {
               parts: [
                Raw {
                 content: "aarch64",
                 position: (27, 26),
                },
               ],
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "x86_64-linux",
                 position: (28, 9),
                },
               ],
              },
              String {
               parts: [
                Raw {
                 content: "x86_64",
                 position: (28, 26),
                },
               ],
              },
             ),
            ],
            recursive: false,
            position: (26, 21),
           },
          ),
          KeyValue(
           AttributePath {
            attributes: [
             Raw {
              content: "systemPlatform",
              position: (31, 7),
             },
            ],
           },
           PropertyAccess {
            expression: Variable {
             identifier: "platformMap",
             position: (31, 24),
            },
            attribute_path: AttributePath {
             attributes: [
              Expression {
               expression: PropertyAccess {
                expression: Variable {
                 identifier: "pkgs",
                 position: (31, 38),
                },
                attribute_path: AttributePath {
                 attributes: [
                  Raw {
                   content: "stdenv",
                   position: (31, 43),
                  },
                  Raw {
                   content: "hostPlatform",
                   position: (31, 50),
                  },
                  Raw {
                   content: "system",
                   position: (31, 63),
                  },
                 ],
                },
                default: None,
               },
              },
             ],
            },
            default: Some(
             FunctionApplication {
              function: Variable {
               identifier: "throw",
               position: (31, 75),
              },
              arguments: [
               String {
                parts: [
                 Raw {
                  content: "scudo not supported on ",
                  position: (31, 82),
                 },
                 Expression {
                  expression: PropertyAccess {
                   expression: Variable {
                    identifier: "pkgs",
                    position: (31, 107),
                   },
                   attribute_path: AttributePath {
                    attributes: [
                     Raw {
                      content: "stdenv",
                      position: (31, 112),
                     },
                     Raw {
                      content: "hostPlatform",
                      position: (31, 119),
                     },
                     Raw {
                      content: "system",
                      position: (31, 132),
                     },
                    ],
                   },
                   default: None,
                  },
                 },
                ],
               },
              ],
             },
            ),
           },
          ),
         ],
         target: Map {
          bindings: [
           KeyValue(
            AttributePath {
             attributes: [
              Raw {
               content: "libPath",
               position: (33, 7),
              },
             ],
            },
            String {
             parts: [
              Expression {
               expression: PropertyAccess {
                expression: Variable {
                 identifier: "pkgs",
                 position: (33, 20),
                },
                attribute_path: AttributePath {
                 attributes: [
                  Raw {
                   content: "llvmPackages_latest",
                   position: (33, 25),
                  },
                  Raw {
                   content: "compiler-rt",
                   position: (33, 45),
                  },
                 ],
                },
                default: None,
               },
              },
              Raw {
               content: "/lib/linux/libclang_rt.scudo-",
               position: (33, 57),
              },
              Expression {
               expression: Variable {
                identifier: "systemPlatform",
                position: (33, 88),
               },
              },
              Raw {
               content: ".so",
               position: (33, 103),
              },
             ],
            },
           ),
           KeyValue(
            AttributePath {
             attributes: [
              Raw {
               content: "description",
               position: (34, 7),
              },
             ],
            },
            String {
             parts: [
              Raw {
               content: "A user-mode allocator based on LLVM Sanitizer’s CombinedAllocator,\nwhich aims at providing additional mitigations against heap based\nvulnerabilities, while maintaining good performance.\n",
               position: (35, 1),
              },
             ],
            },
           ),
          ],
          recursive: false,
          position: (32, 8),
         },
         position: (25, 13),
        },
       ),
       KeyValue(
        AttributePath {
         attributes: [
          Raw {
           content: "mimalloc",
           position: (41, 5),
          },
         ],
        },
        Map {
         bindings: [
          KeyValue(
           AttributePath {
            attributes: [
             Raw {
              content: "libPath",
              position: (42, 7),
             },
            ],
           },
           String {
            parts: [
             Expression {
              expression: PropertyAccess {
               expression: Variable {
                identifier: "pkgs",
                position: (42, 20),
               },
               attribute_path: AttributePath {
                attributes: [
                 Raw {
                  content: "mimalloc",
                  position: (42, 25),
                 },
                ],
               },
               default: None,
              },
             },
             Raw {
              content: "/lib/libmimalloc.so",
              position: (42, 34),
             },
            ],
           },
          ),
          KeyValue(
           AttributePath {
            attributes: [
             Raw {
              content: "description",
              position: (43, 7),
             },
            ],
           },
           String {
            parts: [
             Raw {
              content: "A compact and fast general purpose allocator, which may\noptionally be built with mitigations against various heap\nvulnerabilities.\n",
              position: (44, 1),
             },
            ],
           },
          ),
         ],
         recursive: false,
         position: (41, 16),
        },
       ),
      ],
      recursive: false,
      position: (8, 15),
     },
    ),
    KeyValue(
     AttributePath {
      attributes: [
       Raw {
        content: "providerConf",
        position: (51, 3),
       },
      ],
     },
     PropertyAccess {
      expression: Variable {
       identifier: "providers",
       position: (51, 18),
      },
      attribute_path: AttributePath {
       attributes: [
        Expression {
         expression: PropertyAccess {
          expression: Variable {
           identifier: "cfg",
           position: (51, 30),
          },
          attribute_path: AttributePath {
           attributes: [
            Raw {
             content: "provider",
             position: (51, 34),
            },
           ],
          },
          default: None,
         },
        },
       ],
      },
      default: None,
     },
    ),
    KeyValue(
     AttributePath {
      attributes: [
       Raw {
        content: "mallocLib",
        position: (55, 3),
       },
      ],
     },
     FunctionApplication {
      function: PropertyAccess {
       expression: Variable {
        identifier: "pkgs",
        position: (55, 15),
       },
       attribute_path: AttributePath {
        attributes: [
         Raw {
          content: "runCommand",
          position: (55, 20),
         },
        ],
       },
       default: None,
      },
      arguments: [
       String {
        parts: [
         Raw {
          content: "malloc-provider-",
          position: (55, 32),
         },
         Expression {
          expression: PropertyAccess {
           expression: Variable {
            identifier: "cfg",
            position: (55, 50),
           },
           attribute_path: AttributePath {
            attributes: [
             Raw {
              content: "provider",
              position: (55, 54),
             },
            ],
           },
           default: None,
          },
         },
        ],
       },
       Map {
        bindings: [
         KeyValue(
          AttributePath {
           attributes: [
            Raw {
             content: "preferLocalBuild",
             position: (57, 7),
            },
           ],
          },
          Variable {
           identifier: "true",
           position: (57, 26),
          },
         ),
         KeyValue(
          AttributePath {
           attributes: [
            Raw {
             content: "allowSubstitutes",
             position: (58, 7),
            },
           ],
          },
          Variable {
           identifier: "false",
           position: (58, 26),
          },
         ),
         KeyValue(
          AttributePath {
           attributes: [
            Raw {
             content: "origLibPath",
             position: (59, 7),
            },
           ],
          },
          PropertyAccess {
           expression: Variable {
            identifier: "providerConf",
            position: (59, 21),
           },
           attribute_path: AttributePath {
            attributes: [
             Raw {
              content: "libPath",
              position: (59, 34),
             },
            ],
           },
           default: None,
          },
         ),
         KeyValue(
          AttributePath {
           attributes: [
            Raw {
             content: "libName",
             position: (60, 7),
            },
           ],
          },
          FunctionApplication {
           function: Variable {
            identifier: "baseNameOf",
            position: (60, 17),
           },
           arguments: [
            Variable {
             identifier: "origLibPath",
             position: (60, 28),
            },
           ],
          },
         ),
        ],
        recursive: true,
        position: (56, 5),
       },
       String {
        parts: [
         Raw {
          content: "mkdir -p $out/lib\ncp -L $origLibPath $out/lib/$libName\n",
          position: (63, 1),
         },
        ],
       },
      ],
     },
    ),
    KeyValue(
     AttributePath {
      attributes: [
       Raw {
        content: "providerLibPath",
        position: (68, 3),
       },
      ],
     },
     String {
      parts: [
       Expression {
        expression: Variable {
         identifier: "mallocLib",
         position: (68, 24),
        },
       },
       Raw {
        content: "/lib/",
        position: (68, 34),
       },
       Expression {
        expression: PropertyAccess {
         expression: Variable {
          identifier: "mallocLib",
          position: (68, 41),
         },
         attribute_path: AttributePath {
          attributes: [
           Raw {
            content: "libName",
            position: (68, 51),
           },
          ],
         },
         default: None,
        },
       },
      ],
     },
    ),
   ],
   target: Map {
    bindings: [
     KeyValue(
      AttributePath {
       attributes: [
        Raw {
         content: "meta",
         position: (72, 3),
        },
       ],
      },
      Map {
       bindings: [
        KeyValue(
         AttributePath {
          attributes: [
           Raw {
            content: "maintainers",
            position: (73, 5),
           },
          ],
         },
         List {
          elements: [
           PropertyAccess {
            expression: Variable {
             identifier: "maintainers",
             position: (73, 21),
            },
            attribute_path: AttributePath {
             attributes: [
              Raw {
               content: "joachifm",
               position: (73, 33),
              },
             ],
            },
            default: None,
           },
          ],
          position: (73, 19),
         },
        ),
       ],
       recursive: false,
       position: (72, 10),
      },
     ),
     KeyValue(
      AttributePath {
       attributes: [
        Raw {
         content: "options",
         position: (76, 3),
        },
       ],
      },
      Map {
       bindings: [
        KeyValue(
         AttributePath {
          attributes: [
           Raw {
            content: "environment",
            position: (77, 5),
           },
           Raw {
            content: "memoryAllocator",
            position: (77, 17),
           },
           Raw {
            content: "provider",
            position: (77, 33),
           },
          ],
         },
         FunctionApplication {
          function: Variable {
           identifier: "mkOption",
           position: (77, 44),
          },
          arguments: [
           Map {
            bindings: [
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "type",
                 position: (78, 7),
                },
               ],
              },
              FunctionApplication {
               function: PropertyAccess {
                expression: Variable {
                 identifier: "types",
                 position: (78, 14),
                },
                attribute_path: AttributePath {
                 attributes: [
                  Raw {
                   content: "enum",
                   position: (78, 20),
                  },
                 ],
                },
                default: None,
               },
               arguments: [
                BinaryOperation {
                 operator: Concatenation,
                 operands: [
                  List {
                   elements: [
                    String {
                     parts: [
                      Raw {
                       content: "libc",
                       position: (78, 29),
                      },
                     ],
                    },
                   ],
                   position: (78, 26),
                  },
                  FunctionApplication {
                   function: Variable {
                    identifier: "attrNames",
                    position: (78, 40),
                   },
                   arguments: [
                    Variable {
                     identifier: "providers",
                     position: (78, 50),
                    },
                   ],
                  },
                 ],
                 position: (78, 37),
                },
               ],
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "default",
                 position: (79, 7),
                },
               ],
              },
              String {
               parts: [
                Raw {
                 content: "libc",
                 position: (79, 18),
                },
               ],
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "description",
                 position: (80, 7),
                },
               ],
              },
              String {
               parts: [
                Raw {
                 content: "The system-wide memory allocator.\n\nBriefly, the system-wide memory allocator providers are:\n<itemizedlist>\n<listitem><para><literal>libc</literal>: the standard allocator provided by libc</para></listitem>\n",
                 position: (81, 1),
                },
                Expression {
                 expression: FunctionApplication {
                  function: Variable {
                   identifier: "toString",
                   position: (86, 11),
                  },
                  arguments: [
                   FunctionApplication {
                    function: Variable {
                     identifier: "mapAttrsToList",
                     position: (86, 21),
                    },
                    arguments: [
                     Function {
                      argument: Some(
                       "name",
                      ),
                      arguments: FunctionArguments {
                       arguments: [],
                       ellipsis: false,
                      },
                      definition: Function {
                       argument: Some(
                        "value",
                       ),
                       arguments: FunctionArguments {
                        arguments: [],
                        ellipsis: false,
                       },
                       definition: String {
                        parts: [
                         Raw {
                          content: "<listitem><para><literal>",
                          position: (87, 28),
                         },
                         Expression {
                          expression: Variable {
                           identifier: "name",
                           position: (87, 55),
                          },
                         },
                         Raw {
                          content: "</literal>: ",
                          position: (87, 60),
                         },
                         Expression {
                          expression: PropertyAccess {
                           expression: Variable {
                            identifier: "value",
                            position: (87, 74),
                           },
                           attribute_path: AttributePath {
                            attributes: [
                             Raw {
                              content: "description",
                              position: (87, 80),
                             },
                            ],
                           },
                           default: None,
                          },
                         },
                         Raw {
                          content: "</para></listitem>",
                          position: (87, 92),
                         },
                        ],
                       },
                       position: (87, 20),
                      },
                      position: (87, 14),
                     },
                     Variable {
                      identifier: "providers",
                      position: (88, 13),
                     },
                    ],
                   },
                  ],
                 },
                },
                Raw {
                 content: "\n</itemizedlist>\n\n<warning>\n<para>\nSelecting an alternative allocator (i.e., anything other than\n<literal>libc</literal>) may result in instability, data loss,\nand/or service failure.\n</para>\n</warning>\n",
                 position: (88, 24),
                },
               ],
              },
             ),
            ],
            recursive: false,
            position: (77, 53),
           },
          ],
         },
        ),
       ],
       recursive: false,
       position: (76, 13),
      },
     ),
     KeyValue(
      AttributePath {
       attributes: [
        Raw {
         content: "config",
         position: (102, 3),
        },
       ],
      },
      FunctionApplication {
       function: Variable {
        identifier: "mkIf",
        position: (102, 12),
       },
       arguments: [
        BinaryOperation {
         operator: NotEqualTo,
         operands: [
          PropertyAccess {
           expression: Variable {
            identifier: "cfg",
            position: (102, 18),
           },
           attribute_path: AttributePath {
            attributes: [
             Raw {
              content: "provider",
              position: (102, 22),
             },
            ],
           },
           default: None,
          },
          String {
           parts: [
            Raw {
             content: "libc",
             position: (102, 35),
            },
           ],
          },
         ],
         position: (102, 31),
        },
        Map {
         bindings: [
          KeyValue(
           AttributePath {
            attributes: [
             Raw {
              content: "environment",
              position: (103, 5),
             },
             Raw {
              content: "etc",
              position: (103, 17),
             },
             Expression {
              expression: String {
               parts: [
                Raw {
                 content: "ld-nix.so.preload",
                 position: (103, 22),
                },
               ],
              },
             },
             Raw {
              content: "text",
              position: (103, 41),
             },
            ],
           },
           String {
            parts: [
             Raw {
              content: "",
              position: (104, 1),
             },
             Expression {
              expression: Variable {
               identifier: "providerLibPath",
               position: (104, 9),
              },
             },
             Raw {
              content: "\n",
              position: (104, 25),
             },
            ],
           },
          ),
          KeyValue(
           AttributePath {
            attributes: [
             Raw {
              content: "security",
              position: (106, 5),
             },
             Raw {
              content: "apparmor",
              position: (106, 14),
             },
             Raw {
              content: "includes",
              position: (106, 23),
             },
            ],
           },
           Map {
            bindings: [
             KeyValue(
              AttributePath {
               attributes: [
                Expression {
                 expression: String {
                  parts: [
                   Raw {
                    content: "abstractions/base",
                    position: (107, 8),
                   },
                  ],
                 },
                },
               ],
              },
              String {
               parts: [
                Raw {
                 content: "r /etc/ld-nix.so.preload,\nr ",
                 position: (108, 1),
                },
                Expression {
                 expression: PropertyAccess {
                  expression: Variable {
                   identifier: "config",
                   position: (109, 13),
                  },
                  attribute_path: AttributePath {
                   attributes: [
                    Raw {
                     content: "environment",
                     position: (109, 20),
                    },
                    Raw {
                     content: "etc",
                     position: (109, 32),
                    },
                    Expression {
                     expression: String {
                      parts: [
                       Raw {
                        content: "ld-nix.so.preload",
                        position: (109, 37),
                       },
                      ],
                     },
                    },
                    Raw {
                     content: "source",
                     position: (109, 56),
                    },
                   ],
                  },
                  default: None,
                 },
                },
                Raw {
                 content: ",\ninclude \"",
                 position: (109, 63),
                },
                Expression {
                 expression: FunctionApplication {
                  function: PropertyAccess {
                   expression: Variable {
                    identifier: "pkgs",
                    position: (110, 20),
                   },
                   attribute_path: AttributePath {
                    attributes: [
                     Raw {
                      content: "apparmorRulesFromClosure",
                      position: (110, 25),
                     },
                    ],
                   },
                   default: None,
                  },
                  arguments: [
                   Map {
                    bindings: [
                     KeyValue(
                      AttributePath {
                       attributes: [
                        Raw {
                         content: "name",
                         position: (111, 13),
                        },
                       ],
                      },
                      String {
                       parts: [
                        Raw {
                         content: "mallocLib",
                         position: (111, 21),
                        },
                       ],
                      },
                     ),
                     KeyValue(
                      AttributePath {
                       attributes: [
                        Raw {
                         content: "baseRules",
                         position: (112, 13),
                        },
                       ],
                      },
                      List {
                       elements: [
                        String {
                         parts: [
                          Raw {
                           content: "mr $path/lib/**.so*",
                           position: (112, 27),
                          },
                         ],
                        },
                       ],
                       position: (112, 25),
                      },
                     ),
                    ],
                    recursive: false,
                    position: (110, 50),
                   },
                   List {
                    elements: [
                     Variable {
                      identifier: "mallocLib",
                      position: (113, 15),
                     },
                    ],
                    position: (113, 13),
                   },
                  ],
                 },
                },
                Raw {
                 content: "\"\n",
                 position: (113, 28),
                },
               ],
              },
             ),
            ],
            recursive: false,
            position: (106, 34),
           },
          ),
         ],
         recursive: false,
         position: (102, 42),
        },
       ],
      },
     ),
    ],
    recursive: false,
    position: (71, 1),
   },
   position: (4, 1),
  },
  position: (2, 1),
 },
 position: (1, 1),
}