mirror of
https://github.com/NixOS/mobile-nixos.git
synced 2024-12-18 05:21:47 +03:00
32c93bb9a7
Otherwise, even on simple images, zero-crossing to the next second caused impurities in the build.
40 lines
673 B
Nix
40 lines
673 B
Nix
{ imageBuilder, libfaketime, e2fsprogs, make_ext4fs }:
|
|
|
|
/* */ let scope = { "fileSystem.makeExt4" =
|
|
|
|
let
|
|
inherit (imageBuilder) makeFilesystem;
|
|
in
|
|
{ partitionID, ... } @ args:
|
|
makeFilesystem (args // {
|
|
filesystemType = "ext4";
|
|
|
|
minimumSize = imageBuilder.size.MiB 5;
|
|
|
|
nativeBuildInputs = [
|
|
e2fsprogs
|
|
make_ext4fs
|
|
libfaketime
|
|
];
|
|
|
|
filesystemPhase = ''
|
|
:
|
|
'';
|
|
|
|
copyPhase = ''
|
|
faketime -f "1970-01-01 00:00:00" \
|
|
make_ext4fs \
|
|
-L $partName \
|
|
-l $size \
|
|
-U $partitionID \
|
|
"$img" \
|
|
.
|
|
'';
|
|
|
|
checkPhase = ''
|
|
EXT2FS_NO_MTAB_OK=yes fsck.ext4 -n -f $img
|
|
'';
|
|
})
|
|
|
|
/* */ ;}; in scope."fileSystem.makeExt4"
|