@@ -14,6 +14,7 @@ with lib;
1414let
1515 rootfsImage = pkgs.callPackage ../../../lib/make-ext4-fs.nix ({
1616 inherit (config.sdImage) storePaths;
17+ populateImageCommands = config.sdImage.populateRootCommands;
1718 volumeLabel = "NIXOS_SD";
1819 } // optionalAttrs (config.sdImage.rootPartitionUUID != null) {
1920 uuid = config.sdImage.rootPartitionUUID;
@@ -77,6 +78,16 @@ in
7778 /boot/firmware partition on the SD image.
7879 '';
7980 };
81+
82+ populateRootCommands = mkOption {
83+ example = literalExample "''\${extlinux-conf-builder} -t 3 -c \${config.system.build.toplevel} -d ./files/boot''";
84+ description = ''
85+ Shell commands to populate the ./files directory.
86+ All files in that directory are copied to the
87+ root (/) partition on the SD image. Use this to
88+ populate the ./files/boot (/boot) directory.
89+ '';
90+ };
8091 };
8192
8293 config = {
@@ -117,8 +128,8 @@ in
117128 label: dos
118129 label-id: ${config.sdImage.firmwarePartitionID}
119130
120− start=8M, size=$firmwareSizeBlocks, type=b, bootable
121− start=${toString (8 + config.sdImage.firmwareSize)}M, type=83
131+ start=8M, size=$firmwareSizeBlocks, type=b
132+ start=${toString (8 + config.sdImage.firmwareSize)}M, type=83, bootable
122133 EOF
123134
124135 # Copy the rootfs into the SD image