mirror of
https://github.com/NixOS/mobile-nixos.git
synced 2024-12-17 13:10:29 +03:00
35 lines
708 B
Nix
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"
|