mirror of
https://github.com/cachix/install-nix-action.git
synced 2024-11-27 10:53:56 +00:00
refactor: Format Nix file using Alejandra
This commit is contained in:
parent
e816083727
commit
f4aefd48be
1 changed files with 16 additions and 16 deletions
32
test.nix
32
test.nix
|
@ -1,18 +1,18 @@
|
|||
# Realizes <num>> of derivations with size of <size>MB
|
||||
{ size ? 1 # MB
|
||||
, num ? 10 # count
|
||||
, currentTime ? builtins.currentTime
|
||||
, noChroot ? false
|
||||
{
|
||||
size ? 1, # MB
|
||||
num ? 10, # count
|
||||
currentTime ? builtins.currentTime,
|
||||
noChroot ? false,
|
||||
}:
|
||||
|
||||
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)}
|
||||
''
|
||||
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)}
|
||||
''
|
||||
|
|
Loading…
Reference in a new issue