install-nix-action/test.nix

19 lines
481 B
Nix
Raw Normal View History

2019-09-29 19:52:02 +00:00
# Realizes <num>> of derivations with size of <size>MB
{
size ? 1, # MB
num ? 10, # count
currentTime ? builtins.currentTime,
noChroot ? false,
2019-09-29 19:52:02 +00: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)}
''