---
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: (16, 6),
  },
  target: LetIn {
   bindings: [
    KeyValue(
     AttributePath {
      attributes: [
       Raw {
        content: "rootfsImage",
        position: (19, 3),
       },
      ],
     },
     FunctionApplication {
      function: PropertyAccess {
       expression: Variable {
        identifier: "pkgs",
        position: (19, 17),
       },
       attribute_path: AttributePath {
        attributes: [
         Raw {
          content: "callPackage",
          position: (19, 22),
         },
        ],
       },
       default: None,
      },
      arguments: [
       Path {
        parts: [
         Raw {
          content: "../../../lib/make-ext4-fs.nix",
          position: (19, 34),
         },
        ],
       },
       BinaryOperation {
        operator: Update,
        operands: [
         Map {
          bindings: [
           Inherit(
            Some(
             PropertyAccess {
              expression: Variable {
               identifier: "config",
               position: (20, 14),
              },
              attribute_path: AttributePath {
               attributes: [
                Raw {
                 content: "sdImage",
                 position: (20, 21),
                },
               ],
              },
              default: None,
             },
            ),
            [
             Raw {
              content: "storePaths",
              position: (20, 30),
             },
            ],
           ),
           KeyValue(
            AttributePath {
             attributes: [
              Raw {
               content: "compressImage",
               position: (21, 5),
              },
             ],
            },
            Variable {
             identifier: "true",
             position: (21, 21),
            },
           ),
           KeyValue(
            AttributePath {
             attributes: [
              Raw {
               content: "populateImageCommands",
               position: (22, 5),
              },
             ],
            },
            PropertyAccess {
             expression: Variable {
              identifier: "config",
              position: (22, 29),
             },
             attribute_path: AttributePath {
              attributes: [
               Raw {
                content: "sdImage",
                position: (22, 36),
               },
               Raw {
                content: "populateRootCommands",
                position: (22, 44),
               },
              ],
             },
             default: None,
            },
           ),
           KeyValue(
            AttributePath {
             attributes: [
              Raw {
               content: "volumeLabel",
               position: (23, 5),
              },
             ],
            },
            String {
             parts: [
              Raw {
               content: "NIXOS_SD",
               position: (23, 20),
              },
             ],
            },
           ),
          ],
          recursive: false,
          position: (19, 65),
         },
         FunctionApplication {
          function: Variable {
           identifier: "optionalAttrs",
           position: (24, 8),
          },
          arguments: [
           BinaryOperation {
            operator: NotEqualTo,
            operands: [
             PropertyAccess {
              expression: Variable {
               identifier: "config",
               position: (24, 23),
              },
              attribute_path: AttributePath {
               attributes: [
                Raw {
                 content: "sdImage",
                 position: (24, 30),
                },
                Raw {
                 content: "rootPartitionUUID",
                 position: (24, 38),
                },
               ],
              },
              default: None,
             },
             Variable {
              identifier: "null",
              position: (24, 59),
             },
            ],
            position: (24, 56),
           },
           Map {
            bindings: [
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "uuid",
                 position: (25, 5),
                },
               ],
              },
              PropertyAccess {
               expression: Variable {
                identifier: "config",
                position: (25, 12),
               },
               attribute_path: AttributePath {
                attributes: [
                 Raw {
                  content: "sdImage",
                  position: (25, 19),
                 },
                 Raw {
                  content: "rootPartitionUUID",
                  position: (25, 27),
                 },
                ],
               },
               default: None,
              },
             ),
            ],
            recursive: false,
            position: (24, 65),
           },
          ],
         },
        ],
        position: (24, 5),
       },
      ],
     },
    ),
   ],
   target: Map {
    bindings: [
     KeyValue(
      AttributePath {
       attributes: [
        Raw {
         content: "imports",
         position: (29, 3),
        },
       ],
      },
      List {
       elements: [
        FunctionApplication {
         function: Variable {
          identifier: "mkRemovedOptionModule",
          position: (30, 6),
         },
         arguments: [
          List {
           elements: [
            String {
             parts: [
              Raw {
               content: "sdImage",
               position: (30, 31),
              },
             ],
            },
            String {
             parts: [
              Raw {
               content: "bootPartitionID",
               position: (30, 41),
              },
             ],
            },
           ],
           position: (30, 28),
          },
          String {
           parts: [
            Raw {
             content: "The FAT partition for SD image now only holds the Raspberry Pi firmware files. Use firmwarePartitionID to configure that partition's ID.",
             position: (30, 61),
            },
           ],
          },
         ],
        },
        FunctionApplication {
         function: Variable {
          identifier: "mkRemovedOptionModule",
          position: (31, 6),
         },
         arguments: [
          List {
           elements: [
            String {
             parts: [
              Raw {
               content: "sdImage",
               position: (31, 31),
              },
             ],
            },
            String {
             parts: [
              Raw {
               content: "bootSize",
               position: (31, 41),
              },
             ],
            },
           ],
           position: (31, 28),
          },
          String {
           parts: [
            Raw {
             content: "The boot files for SD image have been moved to the main ext4 partition. The FAT partition now only holds the Raspberry Pi firmware files. Changing its size may not be required.",
             position: (31, 54),
            },
           ],
          },
         ],
        },
        Path {
         parts: [
          Raw {
           content: "../../profiles/all-hardware.nix",
           position: (32, 5),
          },
         ],
        },
       ],
       position: (29, 13),
      },
     ),
     KeyValue(
      AttributePath {
       attributes: [
        Raw {
         content: "options",
         position: (35, 3),
        },
        Raw {
         content: "sdImage",
         position: (35, 11),
        },
       ],
      },
      Map {
       bindings: [
        KeyValue(
         AttributePath {
          attributes: [
           Raw {
            content: "imageName",
            position: (36, 5),
           },
          ],
         },
         FunctionApplication {
          function: Variable {
           identifier: "mkOption",
           position: (36, 17),
          },
          arguments: [
           Map {
            bindings: [
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "default",
                 position: (37, 7),
                },
               ],
              },
              String {
               parts: [
                Expression {
                 expression: PropertyAccess {
                  expression: Variable {
                   identifier: "config",
                   position: (37, 20),
                  },
                  attribute_path: AttributePath {
                   attributes: [
                    Raw {
                     content: "sdImage",
                     position: (37, 27),
                    },
                    Raw {
                     content: "imageBaseName",
                     position: (37, 35),
                    },
                   ],
                  },
                  default: None,
                 },
                },
                Raw {
                 content: "-",
                 position: (37, 49),
                },
                Expression {
                 expression: PropertyAccess {
                  expression: Variable {
                   identifier: "config",
                   position: (37, 52),
                  },
                  attribute_path: AttributePath {
                   attributes: [
                    Raw {
                     content: "system",
                     position: (37, 59),
                    },
                    Raw {
                     content: "nixos",
                     position: (37, 66),
                    },
                    Raw {
                     content: "label",
                     position: (37, 72),
                    },
                   ],
                  },
                  default: None,
                 },
                },
                Raw {
                 content: "-",
                 position: (37, 78),
                },
                Expression {
                 expression: PropertyAccess {
                  expression: Variable {
                   identifier: "pkgs",
                   position: (37, 81),
                  },
                  attribute_path: AttributePath {
                   attributes: [
                    Raw {
                     content: "stdenv",
                     position: (37, 86),
                    },
                    Raw {
                     content: "hostPlatform",
                     position: (37, 93),
                    },
                    Raw {
                     content: "system",
                     position: (37, 106),
                    },
                   ],
                  },
                  default: None,
                 },
                },
                Raw {
                 content: ".img",
                 position: (37, 113),
                },
               ],
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "description",
                 position: (38, 7),
                },
               ],
              },
              String {
               parts: [
                Raw {
                 content: "Name of the generated image file.\n",
                 position: (39, 1),
                },
               ],
              },
             ),
            ],
            recursive: false,
            position: (36, 26),
           },
          ],
         },
        ),
        KeyValue(
         AttributePath {
          attributes: [
           Raw {
            content: "imageBaseName",
            position: (43, 5),
           },
          ],
         },
         FunctionApplication {
          function: Variable {
           identifier: "mkOption",
           position: (43, 21),
          },
          arguments: [
           Map {
            bindings: [
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "default",
                 position: (44, 7),
                },
               ],
              },
              String {
               parts: [
                Raw {
                 content: "nixos-sd-image",
                 position: (44, 18),
                },
               ],
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "description",
                 position: (45, 7),
                },
               ],
              },
              String {
               parts: [
                Raw {
                 content: "Prefix of the name of the generated image file.\n",
                 position: (46, 1),
                },
               ],
              },
             ),
            ],
            recursive: false,
            position: (43, 30),
           },
          ],
         },
        ),
        KeyValue(
         AttributePath {
          attributes: [
           Raw {
            content: "storePaths",
            position: (50, 5),
           },
          ],
         },
         FunctionApplication {
          function: Variable {
           identifier: "mkOption",
           position: (50, 18),
          },
          arguments: [
           Map {
            bindings: [
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "type",
                 position: (51, 7),
                },
               ],
              },
              With {
               expression: Variable {
                identifier: "types",
                position: (51, 19),
               },
               target: FunctionApplication {
                function: Variable {
                 identifier: "listOf",
                 position: (51, 26),
                },
                arguments: [
                 Variable {
                  identifier: "package",
                  position: (51, 33),
                 },
                ],
               },
               position: (51, 14),
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "example",
                 position: (52, 7),
                },
               ],
              },
              FunctionApplication {
               function: Variable {
                identifier: "literalExpression",
                position: (52, 17),
               },
               arguments: [
                String {
                 parts: [
                  Raw {
                   content: "[ pkgs.stdenv ]",
                   position: (52, 36),
                  },
                 ],
                },
               ],
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "description",
                 position: (53, 7),
                },
               ],
              },
              String {
               parts: [
                Raw {
                 content: "Derivations to be included in the Nix store in the generated SD image.\n",
                 position: (54, 1),
                },
               ],
              },
             ),
            ],
            recursive: false,
            position: (50, 27),
           },
          ],
         },
        ),
        KeyValue(
         AttributePath {
          attributes: [
           Raw {
            content: "firmwarePartitionOffset",
            position: (58, 5),
           },
          ],
         },
         FunctionApplication {
          function: Variable {
           identifier: "mkOption",
           position: (58, 31),
          },
          arguments: [
           Map {
            bindings: [
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "type",
                 position: (59, 7),
                },
               ],
              },
              PropertyAccess {
               expression: Variable {
                identifier: "types",
                position: (59, 14),
               },
               attribute_path: AttributePath {
                attributes: [
                 Raw {
                  content: "int",
                  position: (59, 20),
                 },
                ],
               },
               default: None,
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "default",
                 position: (60, 7),
                },
               ],
              },
              Int {
               value: 8,
               position: (60, 17),
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "description",
                 position: (61, 7),
                },
               ],
              },
              String {
               parts: [
                Raw {
                 content: "Gap in front of the /boot/firmware partition, in mebibytes (1024×1024\nbytes).\nCan be increased to make more space for boards requiring to dd u-boot\nSPL before actual partitions.\n\nUnless you are building your own images pre-configured with an\ninstalled U-Boot, you can instead opt to delete the existing `FIRMWARE`\npartition, which is used **only** for the Raspberry Pi family of\nhardware.\n",
                 position: (62, 1),
                },
               ],
              },
             ),
            ],
            recursive: false,
            position: (58, 40),
           },
          ],
         },
        ),
        KeyValue(
         AttributePath {
          attributes: [
           Raw {
            content: "firmwarePartitionID",
            position: (74, 5),
           },
          ],
         },
         FunctionApplication {
          function: Variable {
           identifier: "mkOption",
           position: (74, 27),
          },
          arguments: [
           Map {
            bindings: [
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "type",
                 position: (75, 7),
                },
               ],
              },
              PropertyAccess {
               expression: Variable {
                identifier: "types",
                position: (75, 14),
               },
               attribute_path: AttributePath {
                attributes: [
                 Raw {
                  content: "str",
                  position: (75, 20),
                 },
                ],
               },
               default: None,
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "default",
                 position: (76, 7),
                },
               ],
              },
              String {
               parts: [
                Raw {
                 content: "0x2178694e",
                 position: (76, 18),
                },
               ],
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "description",
                 position: (77, 7),
                },
               ],
              },
              String {
               parts: [
                Raw {
                 content: "Volume ID for the /boot/firmware partition on the SD card. This value\nmust be a 32-bit hexadecimal number.\n",
                 position: (78, 1),
                },
               ],
              },
             ),
            ],
            recursive: false,
            position: (74, 36),
           },
          ],
         },
        ),
        KeyValue(
         AttributePath {
          attributes: [
           Raw {
            content: "firmwarePartitionName",
            position: (83, 5),
           },
          ],
         },
         FunctionApplication {
          function: Variable {
           identifier: "mkOption",
           position: (83, 29),
          },
          arguments: [
           Map {
            bindings: [
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "type",
                 position: (84, 7),
                },
               ],
              },
              PropertyAccess {
               expression: Variable {
                identifier: "types",
                position: (84, 14),
               },
               attribute_path: AttributePath {
                attributes: [
                 Raw {
                  content: "str",
                  position: (84, 20),
                 },
                ],
               },
               default: None,
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "default",
                 position: (85, 7),
                },
               ],
              },
              String {
               parts: [
                Raw {
                 content: "FIRMWARE",
                 position: (85, 18),
                },
               ],
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "description",
                 position: (86, 7),
                },
               ],
              },
              String {
               parts: [
                Raw {
                 content: "Name of the filesystem which holds the boot firmware.\n",
                 position: (87, 1),
                },
               ],
              },
             ),
            ],
            recursive: false,
            position: (83, 38),
           },
          ],
         },
        ),
        KeyValue(
         AttributePath {
          attributes: [
           Raw {
            content: "rootPartitionUUID",
            position: (91, 5),
           },
          ],
         },
         FunctionApplication {
          function: Variable {
           identifier: "mkOption",
           position: (91, 25),
          },
          arguments: [
           Map {
            bindings: [
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "type",
                 position: (92, 7),
                },
               ],
              },
              FunctionApplication {
               function: PropertyAccess {
                expression: Variable {
                 identifier: "types",
                 position: (92, 14),
                },
                attribute_path: AttributePath {
                 attributes: [
                  Raw {
                   content: "nullOr",
                   position: (92, 20),
                  },
                 ],
                },
                default: None,
               },
               arguments: [
                PropertyAccess {
                 expression: Variable {
                  identifier: "types",
                  position: (92, 27),
                 },
                 attribute_path: AttributePath {
                  attributes: [
                   Raw {
                    content: "str",
                    position: (92, 33),
                   },
                  ],
                 },
                 default: None,
                },
               ],
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "default",
                 position: (93, 7),
                },
               ],
              },
              Variable {
               identifier: "null",
               position: (93, 17),
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "example",
                 position: (94, 7),
                },
               ],
              },
              String {
               parts: [
                Raw {
                 content: "14e19a7b-0ae0-484d-9d54-43bd6fdc20c7",
                 position: (94, 18),
                },
               ],
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "description",
                 position: (95, 7),
                },
               ],
              },
              String {
               parts: [
                Raw {
                 content: "UUID for the filesystem on the main NixOS partition on the SD card.\n",
                 position: (96, 1),
                },
               ],
              },
             ),
            ],
            recursive: false,
            position: (91, 34),
           },
          ],
         },
        ),
        KeyValue(
         AttributePath {
          attributes: [
           Raw {
            content: "firmwareSize",
            position: (100, 5),
           },
          ],
         },
         FunctionApplication {
          function: Variable {
           identifier: "mkOption",
           position: (100, 20),
          },
          arguments: [
           Map {
            bindings: [
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "type",
                 position: (101, 7),
                },
               ],
              },
              PropertyAccess {
               expression: Variable {
                identifier: "types",
                position: (101, 14),
               },
               attribute_path: AttributePath {
                attributes: [
                 Raw {
                  content: "int",
                  position: (101, 20),
                 },
                ],
               },
               default: None,
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "default",
                 position: (103, 7),
                },
               ],
              },
              Int {
               value: 30,
               position: (103, 17),
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "description",
                 position: (104, 7),
                },
               ],
              },
              String {
               parts: [
                Raw {
                 content: "Size of the /boot/firmware partition, in megabytes.\n",
                 position: (105, 1),
                },
               ],
              },
             ),
            ],
            recursive: false,
            position: (100, 29),
           },
          ],
         },
        ),
        KeyValue(
         AttributePath {
          attributes: [
           Raw {
            content: "populateFirmwareCommands",
            position: (109, 5),
           },
          ],
         },
         FunctionApplication {
          function: Variable {
           identifier: "mkOption",
           position: (109, 32),
          },
          arguments: [
           Map {
            bindings: [
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "example",
                 position: (110, 7),
                },
               ],
              },
              FunctionApplication {
               function: Variable {
                identifier: "literalExpression",
                position: (110, 17),
               },
               arguments: [
                String {
                 parts: [
                  Raw {
                   content: "'' cp ${pkgs.myBootLoader}/u-boot.bin firmware/ ''",
                   position: (110, 36),
                  },
                 ],
                },
               ],
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "description",
                 position: (111, 7),
                },
               ],
              },
              String {
               parts: [
                Raw {
                 content: "Shell commands to populate the ./firmware directory.\nAll files in that directory are copied to the\n/boot/firmware partition on the SD image.\n",
                 position: (112, 1),
                },
               ],
              },
             ),
            ],
            recursive: false,
            position: (109, 41),
           },
          ],
         },
        ),
        KeyValue(
         AttributePath {
          attributes: [
           Raw {
            content: "populateRootCommands",
            position: (118, 5),
           },
          ],
         },
         FunctionApplication {
          function: Variable {
           identifier: "mkOption",
           position: (118, 28),
          },
          arguments: [
           Map {
            bindings: [
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "example",
                 position: (119, 7),
                },
               ],
              },
              FunctionApplication {
               function: Variable {
                identifier: "literalExpression",
                position: (119, 17),
               },
               arguments: [
                String {
                 parts: [
                  Raw {
                   content: "''${config.boot.loader.generic-extlinux-compatible.populateCmd} -c ${config.system.build.toplevel} -d ./files/boot''",
                   position: (119, 36),
                  },
                 ],
                },
               ],
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "description",
                 position: (120, 7),
                },
               ],
              },
              String {
               parts: [
                Raw {
                 content: "Shell commands to populate the ./files directory.\nAll files in that directory are copied to the\nroot (/) partition on the SD image. Use this to\npopulate the ./files/boot (/boot) directory.\n",
                 position: (121, 1),
                },
               ],
              },
             ),
            ],
            recursive: false,
            position: (118, 37),
           },
          ],
         },
        ),
        KeyValue(
         AttributePath {
          attributes: [
           Raw {
            content: "postBuildCommands",
            position: (128, 5),
           },
          ],
         },
         FunctionApplication {
          function: Variable {
           identifier: "mkOption",
           position: (128, 25),
          },
          arguments: [
           Map {
            bindings: [
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "example",
                 position: (129, 7),
                },
               ],
              },
              FunctionApplication {
               function: Variable {
                identifier: "literalExpression",
                position: (129, 17),
               },
               arguments: [
                String {
                 parts: [
                  Raw {
                   content: "'' dd if=${pkgs.myBootLoader}/SPL of=$img bs=1024 seek=1 conv=notrunc ''",
                   position: (129, 36),
                  },
                 ],
                },
               ],
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "default",
                 position: (130, 7),
                },
               ],
              },
              String {
               parts: [],
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "description",
                 position: (131, 7),
                },
               ],
              },
              String {
               parts: [
                Raw {
                 content: "Shell commands to run after the image is built.\nCan be used for boards requiring to dd u-boot SPL before actual partitions.\n",
                 position: (132, 1),
                },
               ],
              },
             ),
            ],
            recursive: false,
            position: (128, 34),
           },
          ],
         },
        ),
        KeyValue(
         AttributePath {
          attributes: [
           Raw {
            content: "compressImage",
            position: (137, 5),
           },
          ],
         },
         FunctionApplication {
          function: Variable {
           identifier: "mkOption",
           position: (137, 21),
          },
          arguments: [
           Map {
            bindings: [
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "type",
                 position: (138, 7),
                },
               ],
              },
              PropertyAccess {
               expression: Variable {
                identifier: "types",
                position: (138, 14),
               },
               attribute_path: AttributePath {
                attributes: [
                 Raw {
                  content: "bool",
                  position: (138, 20),
                 },
                ],
               },
               default: None,
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "default",
                 position: (139, 7),
                },
               ],
              },
              Variable {
               identifier: "true",
               position: (139, 17),
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "description",
                 position: (140, 7),
                },
               ],
              },
              String {
               parts: [
                Raw {
                 content: "Whether the SD image should be compressed using\n<command>zstd</command>.\n",
                 position: (141, 1),
                },
               ],
              },
             ),
            ],
            recursive: false,
            position: (137, 30),
           },
          ],
         },
        ),
        KeyValue(
         AttributePath {
          attributes: [
           Raw {
            content: "expandOnBoot",
            position: (146, 5),
           },
          ],
         },
         FunctionApplication {
          function: Variable {
           identifier: "mkOption",
           position: (146, 20),
          },
          arguments: [
           Map {
            bindings: [
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "type",
                 position: (147, 7),
                },
               ],
              },
              PropertyAccess {
               expression: Variable {
                identifier: "types",
                position: (147, 14),
               },
               attribute_path: AttributePath {
                attributes: [
                 Raw {
                  content: "bool",
                  position: (147, 20),
                 },
                ],
               },
               default: None,
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "default",
                 position: (148, 7),
                },
               ],
              },
              Variable {
               identifier: "true",
               position: (148, 17),
              },
             ),
             KeyValue(
              AttributePath {
               attributes: [
                Raw {
                 content: "description",
                 position: (149, 7),
                },
               ],
              },
              String {
               parts: [
                Raw {
                 content: "Whether to configure the sd image to expand it's partition on boot.\n",
                 position: (150, 1),
                },
               ],
              },
             ),
            ],
            recursive: false,
            position: (146, 29),
           },
          ],
         },
        ),
       ],
       recursive: false,
       position: (35, 21),
      },
     ),
     KeyValue(
      AttributePath {
       attributes: [
        Raw {
         content: "config",
         position: (155, 3),
        },
       ],
      },
      Map {
       bindings: [
        KeyValue(
         AttributePath {
          attributes: [
           Raw {
            content: "fileSystems",
            position: (156, 5),
           },
          ],
         },
         Map {
          bindings: [
           KeyValue(
            AttributePath {
             attributes: [
              Expression {
               expression: String {
                parts: [
                 Raw {
                  content: "/boot/firmware",
                  position: (157, 8),
                 },
                ],
               },
              },
             ],
            },
            Map {
             bindings: [
              KeyValue(
               AttributePath {
                attributes: [
                 Raw {
                  content: "device",
                  position: (158, 9),
                 },
                ],
               },
               String {
                parts: [
                 Raw {
                  content: "/dev/disk/by-label/",
                  position: (158, 19),
                 },
                 Expression {
                  expression: PropertyAccess {
                   expression: Variable {
                    identifier: "config",
                    position: (158, 40),
                   },
                   attribute_path: AttributePath {
                    attributes: [
                     Raw {
                      content: "sdImage",
                      position: (158, 47),
                     },
                     Raw {
                      content: "firmwarePartitionName",
                      position: (158, 55),
                     },
                    ],
                   },
                   default: None,
                  },
                 },
                ],
               },
              ),
              KeyValue(
               AttributePath {
                attributes: [
                 Raw {
                  content: "fsType",
                  position: (159, 9),
                 },
                ],
               },
               String {
                parts: [
                 Raw {
                  content: "vfat",
                  position: (159, 19),
                 },
                ],
               },
              ),
              KeyValue(
               AttributePath {
                attributes: [
                 Raw {
                  content: "options",
                  position: (163, 9),
                 },
                ],
               },
               List {
                elements: [
                 String {
                  parts: [
                   Raw {
                    content: "nofail",
                    position: (163, 22),
                   },
                  ],
                 },
                 String {
                  parts: [
                   Raw {
                    content: "noauto",
                    position: (163, 31),
                   },
                  ],
                 },
                ],
                position: (163, 19),
               },
              ),
             ],
             recursive: false,
             position: (157, 26),
            },
           ),
           KeyValue(
            AttributePath {
             attributes: [
              Expression {
               expression: String {
                parts: [
                 Raw {
                  content: "/",
                  position: (165, 8),
                 },
                ],
               },
              },
             ],
            },
            Map {
             bindings: [
              KeyValue(
               AttributePath {
                attributes: [
                 Raw {
                  content: "device",
                  position: (166, 9),
                 },
                ],
               },
               String {
                parts: [
                 Raw {
                  content: "/dev/disk/by-label/NIXOS_SD",
                  position: (166, 19),
                 },
                ],
               },
              ),
              KeyValue(
               AttributePath {
                attributes: [
                 Raw {
                  content: "fsType",
                  position: (167, 9),
                 },
                ],
               },
               String {
                parts: [
                 Raw {
                  content: "ext4",
                  position: (167, 19),
                 },
                ],
               },
              ),
             ],
             recursive: false,
             position: (165, 13),
            },
           ),
          ],
          recursive: false,
          position: (156, 19),
         },
        ),
        KeyValue(
         AttributePath {
          attributes: [
           Raw {
            content: "sdImage",
            position: (171, 5),
           },
           Raw {
            content: "storePaths",
            position: (171, 13),
           },
          ],
         },
         List {
          elements: [
           PropertyAccess {
            expression: Variable {
             identifier: "config",
             position: (171, 28),
            },
            attribute_path: AttributePath {
             attributes: [
              Raw {
               content: "system",
               position: (171, 35),
              },
              Raw {
               content: "build",
               position: (171, 42),
              },
              Raw {
               content: "toplevel",
               position: (171, 48),
              },
             ],
            },
            default: None,
           },
          ],
          position: (171, 26),
         },
        ),
        KeyValue(
         AttributePath {
          attributes: [
           Raw {
            content: "system",
            position: (173, 5),
           },
           Raw {
            content: "build",
            position: (173, 12),
           },
           Raw {
            content: "sdImage",
            position: (173, 18),
           },
          ],
         },
         FunctionApplication {
          function: PropertyAccess {
           expression: Variable {
            identifier: "pkgs",
            position: (173, 28),
           },
           attribute_path: AttributePath {
            attributes: [
             Raw {
              content: "callPackage",
              position: (173, 33),
             },
            ],
           },
           default: None,
          },
          arguments: [
           Function {
            argument: None,
            arguments: FunctionArguments {
             arguments: [
              FunctionArgument {
               identifier: "zstd",
               default: None,
              },
              FunctionArgument {
               identifier: "util-linux",
               default: None,
              },
              FunctionArgument {
               identifier: "libfaketime",
               default: None,
              },
              FunctionArgument {
               identifier: "mtools",
               default: None,
              },
              FunctionArgument {
               identifier: "e2fsprogs",
               default: None,
              },
              FunctionArgument {
               identifier: "dosfstools",
               default: None,
              },
              FunctionArgument {
               identifier: "stdenv",
               default: None,
              },
             ],
             ellipsis: false,
            },
            definition: FunctionApplication {
             function: PropertyAccess {
              expression: Variable {
               identifier: "stdenv",
               position: (174, 46),
              },
              attribute_path: AttributePath {
               attributes: [
                Raw {
                 content: "mkDerivation",
                 position: (174, 53),
                },
               ],
              },
              default: None,
             },
             arguments: [
              Map {
               bindings: [
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "name",
                    position: (175, 7),
                   },
                  ],
                 },
                 PropertyAccess {
                  expression: Variable {
                   identifier: "config",
                   position: (175, 14),
                  },
                  attribute_path: AttributePath {
                   attributes: [
                    Raw {
                     content: "sdImage",
                     position: (175, 21),
                    },
                    Raw {
                     content: "imageName",
                     position: (175, 29),
                    },
                   ],
                  },
                  default: None,
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "nativeBuildInputs",
                    position: (177, 7),
                   },
                  ],
                 },
                 List {
                  elements: [
                   Variable {
                    identifier: "dosfstools",
                    position: (177, 29),
                   },
                   Variable {
                    identifier: "e2fsprogs",
                    position: (177, 40),
                   },
                   Variable {
                    identifier: "mtools",
                    position: (177, 50),
                   },
                   Variable {
                    identifier: "libfaketime",
                    position: (177, 57),
                   },
                   Variable {
                    identifier: "util-linux",
                    position: (177, 69),
                   },
                   Variable {
                    identifier: "zstd",
                    position: (177, 80),
                   },
                  ],
                  position: (177, 27),
                 },
                ),
                Inherit(
                 Some(
                  PropertyAccess {
                   expression: Variable {
                    identifier: "config",
                    position: (179, 16),
                   },
                   attribute_path: AttributePath {
                    attributes: [
                     Raw {
                      content: "sdImage",
                      position: (179, 23),
                     },
                    ],
                   },
                   default: None,
                  },
                 ),
                 [
                  Raw {
                   content: "imageName",
                   position: (179, 32),
                  },
                  Raw {
                   content: "compressImage",
                   position: (179, 42),
                  },
                 ],
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "buildCommand",
                    position: (181, 7),
                   },
                  ],
                 },
                 String {
                  parts: [
                   Raw {
                    content: "mkdir -p $out/nix-support $out/sd-image\nexport img=$out/sd-image/",
                    position: (182, 1),
                   },
                   Expression {
                    expression: PropertyAccess {
                     expression: Variable {
                      identifier: "config",
                      position: (183, 36),
                     },
                     attribute_path: AttributePath {
                      attributes: [
                       Raw {
                        content: "sdImage",
                        position: (183, 43),
                       },
                       Raw {
                        content: "imageName",
                        position: (183, 51),
                       },
                      ],
                     },
                     default: None,
                    },
                   },
                   Raw {
                    content: "\n\necho \"",
                    position: (183, 61),
                   },
                   Expression {
                    expression: PropertyAccess {
                     expression: Variable {
                      identifier: "pkgs",
                      position: (185, 17),
                     },
                     attribute_path: AttributePath {
                      attributes: [
                       Raw {
                        content: "stdenv",
                        position: (185, 22),
                       },
                       Raw {
                        content: "buildPlatform",
                        position: (185, 29),
                       },
                       Raw {
                        content: "system",
                        position: (185, 43),
                       },
                      ],
                     },
                     default: None,
                    },
                   },
                   Raw {
                    content: "\" > $out/nix-support/system\nif test -n \"$compressImage\"; then\n  echo \"file sd-image $img.zst\" >> $out/nix-support/hydra-build-products\nelse\n  echo \"file sd-image $img\" >> $out/nix-support/hydra-build-products\nfi\n\necho \"Decompressing rootfs image\"\nzstd -d --no-progress \"",
                    position: (185, 50),
                   },
                   Expression {
                    expression: Variable {
                     identifier: "rootfsImage",
                     position: (193, 34),
                    },
                   },
                   Raw {
                    content: "\" -o ./root-fs.img\n\n# Gap in front of the first partition, in MiB\ngap=",
                    position: (193, 46),
                   },
                   Expression {
                    expression: FunctionApplication {
                     function: Variable {
                      identifier: "toString",
                      position: (196, 15),
                     },
                     arguments: [
                      PropertyAccess {
                       expression: Variable {
                        identifier: "config",
                        position: (196, 24),
                       },
                       attribute_path: AttributePath {
                        attributes: [
                         Raw {
                          content: "sdImage",
                          position: (196, 31),
                         },
                         Raw {
                          content: "firmwarePartitionOffset",
                          position: (196, 39),
                         },
                        ],
                       },
                       default: None,
                      },
                     ],
                    },
                   },
                   Raw {
                    content: "\n\n# Create the image file sized to fit /boot/firmware and /, plus slack for the gap.\nrootSizeBlocks=$(du -B 512 --apparent-size ./root-fs.img | awk '{ print $1 }')\nfirmwareSizeBlocks=$((",
                    position: (196, 63),
                   },
                   Expression {
                    expression: FunctionApplication {
                     function: Variable {
                      identifier: "toString",
                      position: (200, 33),
                     },
                     arguments: [
                      PropertyAccess {
                       expression: Variable {
                        identifier: "config",
                        position: (200, 42),
                       },
                       attribute_path: AttributePath {
                        attributes: [
                         Raw {
                          content: "sdImage",
                          position: (200, 49),
                         },
                         Raw {
                          content: "firmwareSize",
                          position: (200, 57),
                         },
                        ],
                       },
                       default: None,
                      },
                     ],
                    },
                   },
                   Raw {
                    content: " * 1024 * 1024 / 512))\nimageSize=$((rootSizeBlocks * 512 + firmwareSizeBlocks * 512 + gap * 1024 * 1024))\ntruncate -s $imageSize $img\n\n# type=b is 'W95 FAT32', type=83 is 'Linux'.\n# The \"bootable\" partition is where u-boot will look file for the bootloader\n# information (dtbs, extlinux.conf file).\nsfdisk $img <<EOF\n    label: dos\n    label-id: ",
                    position: (200, 70),
                   },
                   Expression {
                    expression: PropertyAccess {
                     expression: Variable {
                      identifier: "config",
                      position: (209, 25),
                     },
                     attribute_path: AttributePath {
                      attributes: [
                       Raw {
                        content: "sdImage",
                        position: (209, 32),
                       },
                       Raw {
                        content: "firmwarePartitionID",
                        position: (209, 40),
                       },
                      ],
                     },
                     default: None,
                    },
                   },
                   Raw {
                    content: "\n\n    start=",
                    position: (209, 60),
                   },
                   Raw {
                    content: "$",
                    position: (211, 19),
                   },
                   Raw {
                    content: "{gap}M, size=$firmwareSizeBlocks, type=b\n    start=$((gap + ",
                    position: (211, 22),
                   },
                   Expression {
                    expression: FunctionApplication {
                     function: Variable {
                      identifier: "toString",
                      position: (212, 30),
                     },
                     arguments: [
                      PropertyAccess {
                       expression: Variable {
                        identifier: "config",
                        position: (212, 39),
                       },
                       attribute_path: AttributePath {
                        attributes: [
                         Raw {
                          content: "sdImage",
                          position: (212, 46),
                         },
                         Raw {
                          content: "firmwareSize",
                          position: (212, 54),
                         },
                        ],
                       },
                       default: None,
                      },
                     ],
                    },
                   },
                   Raw {
                    content: "))M, type=83, bootable\nEOF\n\n# Copy the rootfs into the SD image\neval $(partx $img -o START,SECTORS --nr 2 --pairs)\ndd conv=notrunc if=./root-fs.img of=$img seek=$START count=$SECTORS\n\n# Create a FAT32 /boot/firmware partition of suitable size into firmware_part.img\neval $(partx $img -o START,SECTORS --nr 1 --pairs)\ntruncate -s $((SECTORS * 512)) firmware_part.img\nfaketime \"1970-01-01 00:00:00\" mkfs.vfat -i ",
                    position: (212, 67),
                   },
                   Expression {
                    expression: PropertyAccess {
                     expression: Variable {
                      identifier: "config",
                      position: (222, 55),
                     },
                     attribute_path: AttributePath {
                      attributes: [
                       Raw {
                        content: "sdImage",
                        position: (222, 62),
                       },
                       Raw {
                        content: "firmwarePartitionID",
                        position: (222, 70),
                       },
                      ],
                     },
                     default: None,
                    },
                   },
                   Raw {
                    content: " -n ",
                    position: (222, 90),
                   },
                   Expression {
                    expression: PropertyAccess {
                     expression: Variable {
                      identifier: "config",
                      position: (222, 96),
                     },
                     attribute_path: AttributePath {
                      attributes: [
                       Raw {
                        content: "sdImage",
                        position: (222, 103),
                       },
                       Raw {
                        content: "firmwarePartitionName",
                        position: (222, 111),
                       },
                      ],
                     },
                     default: None,
                    },
                   },
                   Raw {
                    content: " firmware_part.img\n\n# Populate the files intended for /boot/firmware\nmkdir firmware\n",
                    position: (222, 133),
                   },
                   Expression {
                    expression: PropertyAccess {
                     expression: Variable {
                      identifier: "config",
                      position: (226, 11),
                     },
                     attribute_path: AttributePath {
                      attributes: [
                       Raw {
                        content: "sdImage",
                        position: (226, 18),
                       },
                       Raw {
                        content: "populateFirmwareCommands",
                        position: (226, 26),
                       },
                      ],
                     },
                     default: None,
                    },
                   },
                   Raw {
                    content: "\n\n# Copy the populated /boot/firmware into the SD image\n(cd firmware; mcopy -psvm -i ../firmware_part.img ./* ::)\n# Verify the FAT partition before copying it.\nfsck.vfat -vn firmware_part.img\ndd conv=notrunc if=firmware_part.img of=$img seek=$START count=$SECTORS\n\n",
                    position: (226, 51),
                   },
                   Expression {
                    expression: PropertyAccess {
                     expression: Variable {
                      identifier: "config",
                      position: (234, 11),
                     },
                     attribute_path: AttributePath {
                      attributes: [
                       Raw {
                        content: "sdImage",
                        position: (234, 18),
                       },
                       Raw {
                        content: "postBuildCommands",
                        position: (234, 26),
                       },
                      ],
                     },
                     default: None,
                    },
                   },
                   Raw {
                    content: "\n\nif test -n \"$compressImage\"; then\n    zstd -T$NIX_BUILD_CORES --rm $img\nfi\n",
                    position: (234, 44),
                   },
                  ],
                 },
                ),
               ],
               recursive: false,
               position: (174, 66),
              },
             ],
            },
            position: (173, 46),
           },
           Map {
            bindings: [],
            recursive: false,
            position: (240, 8),
           },
          ],
         },
        ),
        KeyValue(
         AttributePath {
          attributes: [
           Raw {
            content: "boot",
            position: (242, 5),
           },
           Raw {
            content: "postBootCommands",
            position: (242, 10),
           },
          ],
         },
         FunctionApplication {
          function: PropertyAccess {
           expression: Variable {
            identifier: "lib",
            position: (242, 29),
           },
           attribute_path: AttributePath {
            attributes: [
             Raw {
              content: "mkIf",
              position: (242, 33),
             },
            ],
           },
           default: None,
          },
          arguments: [
           PropertyAccess {
            expression: Variable {
             identifier: "config",
             position: (242, 38),
            },
            attribute_path: AttributePath {
             attributes: [
              Raw {
               content: "sdImage",
               position: (242, 45),
              },
              Raw {
               content: "expandOnBoot",
               position: (242, 53),
              },
             ],
            },
            default: None,
           },
           String {
            parts: [
             Raw {
              content: "# On the first boot do some maintenance tasks\nif [ -f /nix-path-registration ]; then\n  set -euo pipefail\n  set -x\n  # Figure out device names for the boot device and root filesystem.\n  rootPart=$(",
              position: (243, 1),
             },
             Expression {
              expression: PropertyAccess {
               expression: Variable {
                identifier: "pkgs",
                position: (248, 22),
               },
               attribute_path: AttributePath {
                attributes: [
                 Raw {
                  content: "util-linux",
                  position: (248, 27),
                 },
                ],
               },
               default: None,
              },
             },
             Raw {
              content: "/bin/findmnt -n -o SOURCE /)\n  bootDevice=$(lsblk -npo PKNAME $rootPart)\n  partNum=$(lsblk -npo MAJ:MIN $rootPart | ",
              position: (248, 38),
             },
             Expression {
              expression: PropertyAccess {
               expression: Variable {
                identifier: "pkgs",
                position: (250, 52),
               },
               attribute_path: AttributePath {
                attributes: [
                 Raw {
                  content: "gawk",
                  position: (250, 57),
                 },
                ],
               },
               default: None,
              },
             },
             Raw {
              content: "/bin/awk -F: '{print $2}')\n\n  # Resize the root partition and the filesystem to fit the disk\n  echo \",+,\" | sfdisk -N$partNum --no-reread $bootDevice\n  ",
              position: (250, 62),
             },
             Expression {
              expression: PropertyAccess {
               expression: Variable {
                identifier: "pkgs",
                position: (254, 11),
               },
               attribute_path: AttributePath {
                attributes: [
                 Raw {
                  content: "parted",
                  position: (254, 16),
                 },
                ],
               },
               default: None,
              },
             },
             Raw {
              content: "/bin/partprobe\n  ",
              position: (254, 23),
             },
             Expression {
              expression: PropertyAccess {
               expression: Variable {
                identifier: "pkgs",
                position: (255, 11),
               },
               attribute_path: AttributePath {
                attributes: [
                 Raw {
                  content: "e2fsprogs",
                  position: (255, 16),
                 },
                ],
               },
               default: None,
              },
             },
             Raw {
              content: "/bin/resize2fs $rootPart\n\n  # Register the contents of the initial Nix store\n  ",
              position: (255, 26),
             },
             Expression {
              expression: PropertyAccess {
               expression: Variable {
                identifier: "config",
                position: (258, 11),
               },
               attribute_path: AttributePath {
                attributes: [
                 Raw {
                  content: "nix",
                  position: (258, 18),
                 },
                 Raw {
                  content: "package",
                  position: (258, 22),
                 },
                 Raw {
                  content: "out",
                  position: (258, 30),
                 },
                ],
               },
               default: None,
              },
             },
             Raw {
              content: "/bin/nix-store --load-db < /nix-path-registration\n\n  # nixos-rebuild also requires a \"system\" profile and an /etc/NIXOS tag.\n  touch /etc/NIXOS\n  ",
              position: (258, 34),
             },
             Expression {
              expression: PropertyAccess {
               expression: Variable {
                identifier: "config",
                position: (262, 11),
               },
               attribute_path: AttributePath {
                attributes: [
                 Raw {
                  content: "nix",
                  position: (262, 18),
                 },
                 Raw {
                  content: "package",
                  position: (262, 22),
                 },
                 Raw {
                  content: "out",
                  position: (262, 30),
                 },
                ],
               },
               default: None,
              },
             },
             Raw {
              content: "/bin/nix-env -p /nix/var/nix/profiles/system --set /run/current-system\n\n  # Prevents this from running on later boots.\n  rm -f /nix-path-registration\nfi\n",
              position: (262, 34),
             },
            ],
           },
          ],
         },
        ),
       ],
       recursive: false,
       position: (155, 12),
      },
     ),
    ],
    recursive: false,
    position: (28, 1),
   },
   position: (18, 1),
  },
  position: (16, 1),
 },
 position: (14, 1),
}