2019-09-30 05:52:02 +10:00
|
|
|
# Realizes <num>> of derivations with size of <size>MB
|
|
|
|
{ size ? 1 # MB
|
|
|
|
, num ? 10 # count
|
|
|
|
, currentTime ? builtins.currentTime
|
2020-08-26 02:13:35 +10:00
|
|
|
, noChroot ? false
|
2019-09-30 05:52:02 +10:00
|
|
|
}:
|
|
|
|
|
|
|
|
with import <nixpkgs> {};
|
|
|
|
|
|
|
|
let
|
2020-08-26 02:13:35 +10:00
|
|
|
drv = i: runCommand "${toString currentTime}-${toString i}" {
|
|
|
|
__noChroot = noChroot;
|
|
|
|
} ''
|
2019-09-30 05:52:02 +10:00
|
|
|
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)}
|
2020-08-26 02:13:35 +10:00
|
|
|
''
|