1
1
mirror of https://github.com/NixOS/mobile-nixos.git synced 2024-12-17 13:10:29 +03:00
mobile-nixos/lib/image-builder/makeFAT32.nix
Samuel Dionne-Riel 549f0b55eb WIP adds makeFAT32
2019-08-27 14:14:57 -04:00

35 lines
708 B
Nix

{ makePartition, dosfstools, mtools, libfaketime }:
/* */ let scope = { "fileSystem.makeFAT32" =
{ partitionID, ... } @ args:
makePartition (args // {
# FAT32 can be used for ESP. Let's make this obvious.
filesystemType = if args ? filesystemType then args.filesystemType else "FAT32";
nativeBuildInputs = [
libfaketime
dosfstools
mtools
];
filesystemPhase = ''
faketime "1970-01-01 00:00:00" mkfs.vfat \
-i $partitionID \
-n $partName \
"$img"
'';
copyPhase = ''
# FIXME : here mcopy files
echo ... would copy here ...
'';
checkPhase = ''
# Always verify FS
fsck.vfat -vn "$img"
'';
})
/* */ ;}; in scope."fileSystem.makeFAT32"