mirror of
https://github.com/cachix/install-nix-action.git
synced 2024-11-22 00:20:53 +00:00
15 lines
No EOL
410 B
Nix
15 lines
No EOL
410 B
Nix
# Realizes <num>> of derivations with size of <size>MB
|
|
{ size ? 1 # MB
|
|
, num ? 10 # count
|
|
, currentTime ? builtins.currentTime
|
|
}:
|
|
|
|
with import <nixpkgs> {};
|
|
|
|
let
|
|
drv = i: runCommand "${toString currentTime}-${toString i}" {} ''
|
|
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)}
|
|
'' |