2019-09-30 05:52:02 +10:00
|
|
|
# Realizes <num>> of derivations with size of <size>MB
|
2023-03-10 09:52:03 +11:00
|
|
|
{
|
|
|
|
size ? 1, # MB
|
|
|
|
num ? 10, # count
|
|
|
|
currentTime ? builtins.currentTime,
|
|
|
|
noChroot ? false,
|
2019-09-30 05:52:02 +10:00
|
|
|
}:
|
2023-03-10 09:52:03 +11:00
|
|
|
with import <nixpkgs> {}; let
|
|
|
|
drv = i:
|
|
|
|
runCommand "${toString currentTime}-${toString i}" {
|
|
|
|
__noChroot = noChroot;
|
|
|
|
} ''
|
|
|
|
dd if=/dev/zero of=$out bs=${toString size}MB count=1
|
|
|
|
'';
|
|
|
|
in
|
|
|
|
writeText "empty-${toString num}-${toString size}MB" ''
|
|
|
|
${lib.concatMapStringsSep "" drv (lib.range 1 num)}
|
|
|
|
''
|