Skip to content

Commit

Permalink
refactor: Format Nix file using Alejandra
Browse files Browse the repository at this point in the history
  • Loading branch information
l0b0 committed Jul 25, 2023
1 parent 92bb297 commit 128cc17
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions test.nix
Original file line number Diff line number Diff line change
@@ -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)}
''

0 comments on commit 128cc17

Please sign in to comment.