---
Function {
 argument: None,
 arguments: FunctionArguments {
  arguments: [
   FunctionArgument {
    identifier: "lib",
    default: None,
   },
   FunctionArgument {
    identifier: "pkgs",
    default: None,
   },
   FunctionArgument {
    identifier: "cfg",
    default: None,
   },
  ],
  ellipsis: false,
 },
 definition: LetIn {
  bindings: [
   KeyValue(
    AttributePath {
     attributes: [
      Raw {
       content: "propertyXml",
       position: (3, 3),
      },
     ],
    },
    Function {
     argument: Some(
      "name",
     ),
     arguments: FunctionArguments {
      arguments: [],
      ellipsis: false,
     },
     definition: Function {
      argument: Some(
       "value",
      ),
      arguments: FunctionArguments {
       arguments: [],
       ellipsis: false,
      },
      definition: FunctionApplication {
       function: PropertyAccess {
        expression: Variable {
         identifier: "lib",
         position: (3, 30),
        },
        attribute_path: AttributePath {
         attributes: [
          Raw {
           content: "optionalString",
           position: (3, 34),
          },
         ],
        },
        default: None,
       },
       arguments: [
        BinaryOperation {
         operator: NotEqualTo,
         operands: [
          Variable {
           identifier: "value",
           position: (3, 50),
          },
          Variable {
           identifier: "null",
           position: (3, 59),
          },
         ],
         position: (3, 56),
        },
        String {
         parts: [
          Raw {
           content: "<property>\n  <name>",
          },
          Expression {
           expression: Variable {
            identifier: "name",
            position: (5, 15),
           },
          },
          Raw {
           content: "</name>\n  <value>",
          },
          Expression {
           expression: FunctionApplication {
            function: PropertyAccess {
             expression: Variable {
              identifier: "builtins",
              position: (6, 16),
             },
             attribute_path: AttributePath {
              attributes: [
               Raw {
                content: "toString",
                position: (6, 25),
               },
              ],
             },
             default: None,
            },
            arguments: [
             Variable {
              identifier: "value",
              position: (6, 34),
             },
            ],
           },
          },
          Raw {
           content: "</value>\n</property>\n",
          },
         ],
         position: (3, 65),
        },
       ],
      },
      position: (3, 23),
     },
     position: (3, 17),
    },
   ),
   KeyValue(
    AttributePath {
     attributes: [
      Raw {
       content: "siteXml",
       position: (9, 3),
      },
     ],
    },
    Function {
     argument: Some(
      "fileName",
     ),
     arguments: FunctionArguments {
      arguments: [],
      ellipsis: false,
     },
     definition: Function {
      argument: Some(
       "properties",
      ),
      arguments: FunctionArguments {
       arguments: [],
       ellipsis: false,
      },
      definition: FunctionApplication {
       function: PropertyAccess {
        expression: Variable {
         identifier: "pkgs",
         position: (9, 35),
        },
        attribute_path: AttributePath {
         attributes: [
          Raw {
           content: "writeTextDir",
           position: (9, 40),
          },
         ],
        },
        default: None,
       },
       arguments: [
        Variable {
         identifier: "fileName",
         position: (9, 53),
        },
        String {
         parts: [
          Raw {
           content: "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<!-- generated by NixOS -->\n<configuration>\n  ",
          },
          Expression {
           expression: FunctionApplication {
            function: PropertyAccess {
             expression: Variable {
              identifier: "builtins",
              position: (13, 9),
             },
             attribute_path: AttributePath {
              attributes: [
               Raw {
                content: "concatStringsSep",
                position: (13, 18),
               },
              ],
             },
             default: None,
            },
            arguments: [
             String {
              parts: [
               Raw {
                content: "\n",
               },
              ],
              position: (13, 35),
             },
             FunctionApplication {
              function: PropertyAccess {
               expression: Variable {
                identifier: "pkgs",
                position: (13, 41),
               },
               attribute_path: AttributePath {
                attributes: [
                 Raw {
                  content: "lib",
                  position: (13, 46),
                 },
                 Raw {
                  content: "mapAttrsToList",
                  position: (13, 50),
                 },
                ],
               },
               default: None,
              },
              arguments: [
               Variable {
                identifier: "propertyXml",
                position: (13, 65),
               },
               Variable {
                identifier: "properties",
                position: (13, 77),
               },
              ],
             },
            ],
           },
          },
          Raw {
           content: "\n</configuration>\n",
          },
         ],
         position: (9, 62),
        },
       ],
      },
      position: (9, 23),
     },
     position: (9, 13),
    },
   ),
   KeyValue(
    AttributePath {
     attributes: [
      Raw {
       content: "cfgLine",
       position: (16, 3),
      },
     ],
    },
    Function {
     argument: Some(
      "name",
     ),
     arguments: FunctionArguments {
      arguments: [],
      ellipsis: false,
     },
     definition: Function {
      argument: Some(
       "value",
      ),
      arguments: FunctionArguments {
       arguments: [],
       ellipsis: false,
      },
      definition: String {
       parts: [
        Raw {
         content: "",
        },
        Expression {
         expression: Variable {
          identifier: "name",
          position: (17, 7),
         },
        },
        Raw {
         content: "=",
        },
        Expression {
         expression: FunctionApplication {
          function: PropertyAccess {
           expression: Variable {
            identifier: "builtins",
            position: (17, 15),
           },
           attribute_path: AttributePath {
            attributes: [
             Raw {
              content: "toString",
              position: (17, 24),
             },
            ],
           },
           default: None,
          },
          arguments: [
           Variable {
            identifier: "value",
            position: (17, 33),
           },
          ],
         },
        },
        Raw {
         content: "\n",
        },
       ],
       position: (16, 26),
      },
      position: (16, 19),
     },
     position: (16, 13),
    },
   ),
   KeyValue(
    AttributePath {
     attributes: [
      Raw {
       content: "cfgFile",
       position: (19, 3),
      },
     ],
    },
    Function {
     argument: Some(
      "fileName",
     ),
     arguments: FunctionArguments {
      arguments: [],
      ellipsis: false,
     },
     definition: Function {
      argument: Some(
       "properties",
      ),
      arguments: FunctionArguments {
       arguments: [],
       ellipsis: false,
      },
      definition: FunctionApplication {
       function: PropertyAccess {
        expression: Variable {
         identifier: "pkgs",
         position: (19, 35),
        },
        attribute_path: AttributePath {
         attributes: [
          Raw {
           content: "writeTextDir",
           position: (19, 40),
          },
         ],
        },
        default: None,
       },
       arguments: [
        Variable {
         identifier: "fileName",
         position: (19, 53),
        },
        String {
         parts: [
          Raw {
           content: "# generated by NixOS\n",
          },
          Expression {
           expression: FunctionApplication {
            function: PropertyAccess {
             expression: Variable {
              identifier: "builtins",
              position: (21, 7),
             },
             attribute_path: AttributePath {
              attributes: [
               Raw {
                content: "concatStringsSep",
                position: (21, 16),
               },
              ],
             },
             default: None,
            },
            arguments: [
             String {
              parts: [],
              position: (21, 33),
             },
             FunctionApplication {
              function: PropertyAccess {
               expression: Variable {
                identifier: "pkgs",
                position: (21, 37),
               },
               attribute_path: AttributePath {
                attributes: [
                 Raw {
                  content: "lib",
                  position: (21, 42),
                 },
                 Raw {
                  content: "mapAttrsToList",
                  position: (21, 46),
                 },
                ],
               },
               default: None,
              },
              arguments: [
               Variable {
                identifier: "cfgLine",
                position: (21, 61),
               },
               Variable {
                identifier: "properties",
                position: (21, 69),
               },
              ],
             },
            ],
           },
          },
          Raw {
           content: "\n",
          },
         ],
         position: (19, 62),
        },
       ],
      },
      position: (19, 23),
     },
     position: (19, 13),
    },
   ),
   KeyValue(
    AttributePath {
     attributes: [
      Raw {
       content: "userFunctions",
       position: (23, 3),
      },
     ],
    },
    String {
     parts: [
      Raw {
       content: "hadoop_verify_logdir() {\n  echo Skipping verification of log directory\n}\n",
      },
     ],
     position: (23, 19),
    },
   ),
   KeyValue(
    AttributePath {
     attributes: [
      Raw {
       content: "hadoopEnv",
       position: (28, 3),
      },
     ],
    },
    String {
     parts: [
      Raw {
       content: "export HADOOP_LOG_DIR=/tmp/hadoop/$USER\n",
      },
     ],
     position: (28, 15),
    },
   ),
  ],
  target: FunctionApplication {
   function: PropertyAccess {
    expression: Variable {
     identifier: "pkgs",
     position: (32, 1),
    },
    attribute_path: AttributePath {
     attributes: [
      Raw {
       content: "runCommand",
       position: (32, 6),
      },
     ],
    },
    default: None,
   },
   arguments: [
    String {
     parts: [
      Raw {
       content: "hadoop-conf",
      },
     ],
     position: (32, 17),
    },
    Map {
     bindings: [],
     recursive: false,
     position: (32, 31),
    },
    With {
     expression: Variable {
      identifier: "cfg",
      position: (32, 40),
     },
     target: String {
      parts: [
       Raw {
        content: "mkdir -p $out/\ncp ",
       },
       Expression {
        expression: FunctionApplication {
         function: Variable {
          identifier: "siteXml",
          position: (34, 8),
         },
         arguments: [
          String {
           parts: [
            Raw {
             content: "core-site.xml",
            },
           ],
           position: (34, 16),
          },
          BinaryOperation {
           operator: Update,
           operands: [
            Variable {
             identifier: "coreSite",
             position: (34, 33),
            },
            Variable {
             identifier: "coreSiteInternal",
             position: (34, 45),
            },
           ],
           position: (34, 42),
          },
         ],
        },
       },
       Raw {
        content: "/* $out/\ncp ",
       },
       Expression {
        expression: FunctionApplication {
         function: Variable {
          identifier: "siteXml",
          position: (35, 8),
         },
         arguments: [
          String {
           parts: [
            Raw {
             content: "hdfs-site.xml",
            },
           ],
           position: (35, 16),
          },
          BinaryOperation {
           operator: Update,
           operands: [
            Variable {
             identifier: "hdfsSiteDefault",
             position: (35, 33),
            },
            BinaryOperation {
             operator: Update,
             operands: [
              Variable {
               identifier: "hdfsSite",
               position: (35, 52),
              },
              Variable {
               identifier: "hdfsSiteInternal",
               position: (35, 64),
              },
             ],
             position: (35, 61),
            },
           ],
           position: (35, 49),
          },
         ],
        },
       },
       Raw {
        content: "/* $out/\ncp ",
       },
       Expression {
        expression: FunctionApplication {
         function: Variable {
          identifier: "siteXml",
          position: (36, 8),
         },
         arguments: [
          String {
           parts: [
            Raw {
             content: "mapred-site.xml",
            },
           ],
           position: (36, 16),
          },
          BinaryOperation {
           operator: Update,
           operands: [
            Variable {
             identifier: "mapredSiteDefault",
             position: (36, 35),
            },
            Variable {
             identifier: "mapredSite",
             position: (36, 56),
            },
           ],
           position: (36, 53),
          },
         ],
        },
       },
       Raw {
        content: "/* $out/\ncp ",
       },
       Expression {
        expression: FunctionApplication {
         function: Variable {
          identifier: "siteXml",
          position: (37, 8),
         },
         arguments: [
          String {
           parts: [
            Raw {
             content: "yarn-site.xml",
            },
           ],
           position: (37, 16),
          },
          BinaryOperation {
           operator: Update,
           operands: [
            Variable {
             identifier: "yarnSiteDefault",
             position: (37, 33),
            },
            BinaryOperation {
             operator: Update,
             operands: [
              Variable {
               identifier: "yarnSite",
               position: (37, 52),
              },
              Variable {
               identifier: "yarnSiteInternal",
               position: (37, 64),
              },
             ],
             position: (37, 61),
            },
           ],
           position: (37, 49),
          },
         ],
        },
       },
       Raw {
        content: "/* $out/\ncp ",
       },
       Expression {
        expression: FunctionApplication {
         function: Variable {
          identifier: "siteXml",
          position: (38, 8),
         },
         arguments: [
          String {
           parts: [
            Raw {
             content: "httpfs-site.xml",
            },
           ],
           position: (38, 16),
          },
          Variable {
           identifier: "httpfsSite",
           position: (38, 34),
          },
         ],
        },
       },
       Raw {
        content: "/* $out/\ncp ",
       },
       Expression {
        expression: FunctionApplication {
         function: Variable {
          identifier: "cfgFile",
          position: (39, 8),
         },
         arguments: [
          String {
           parts: [
            Raw {
             content: "container-executor.cfg",
            },
           ],
           position: (39, 16),
          },
          Variable {
           identifier: "containerExecutorCfg",
           position: (39, 41),
          },
         ],
        },
       },
       Raw {
        content: "/* $out/\ncp ",
       },
       Expression {
        expression: FunctionApplication {
         function: PropertyAccess {
          expression: Variable {
           identifier: "pkgs",
           position: (40, 8),
          },
          attribute_path: AttributePath {
           attributes: [
            Raw {
             content: "writeTextDir",
             position: (40, 13),
            },
           ],
          },
          default: None,
         },
         arguments: [
          String {
           parts: [
            Raw {
             content: "hadoop-user-functions.sh",
            },
           ],
           position: (40, 26),
          },
          Variable {
           identifier: "userFunctions",
           position: (40, 53),
          },
         ],
        },
       },
       Raw {
        content: "/* $out/\ncp ",
       },
       Expression {
        expression: FunctionApplication {
         function: PropertyAccess {
          expression: Variable {
           identifier: "pkgs",
           position: (41, 8),
          },
          attribute_path: AttributePath {
           attributes: [
            Raw {
             content: "writeTextDir",
             position: (41, 13),
            },
           ],
          },
          default: None,
         },
         arguments: [
          String {
           parts: [
            Raw {
             content: "hadoop-env.sh",
            },
           ],
           position: (41, 26),
          },
          Variable {
           identifier: "hadoopEnv",
           position: (41, 42),
          },
         ],
        },
       },
       Raw {
        content: "/* $out/\ncp ",
       },
       Expression {
        expression: Variable {
         identifier: "log4jProperties",
         position: (42, 8),
        },
       },
       Raw {
        content: " $out/log4j.properties\n",
       },
       Expression {
        expression: FunctionApplication {
         function: PropertyAccess {
          expression: Variable {
           identifier: "lib",
           position: (43, 5),
          },
          attribute_path: AttributePath {
           attributes: [
            Raw {
             content: "concatMapStringsSep",
             position: (43, 9),
            },
           ],
          },
          default: None,
         },
         arguments: [
          String {
           parts: [
            Raw {
             content: "\n",
            },
           ],
           position: (43, 29),
          },
          Function {
           argument: Some(
            "dir",
           ),
           arguments: FunctionArguments {
            arguments: [],
            ellipsis: false,
           },
           definition: String {
            parts: [
             Raw {
              content: "cp -r ",
             },
             Expression {
              expression: Variable {
               identifier: "dir",
               position: (43, 49),
              },
             },
             Raw {
              content: "/* $out/",
             },
            ],
            position: (43, 40),
           },
           position: (43, 35),
          },
          Variable {
           identifier: "extraConfDirs",
           position: (43, 64),
          },
         ],
        },
       },
       Raw {
        content: "\n",
       },
      ],
      position: (32, 45),
     },
     position: (32, 35),
    },
   ],
  },
  position: (2, 1),
 },
 position: (1, 1),
}