add speedtest filesystem helper
This commit is contained in:
parent
222de09642
commit
ea9340a612
2 changed files with 17 additions and 4 deletions
|
|
@ -24,6 +24,7 @@
|
|||
};
|
||||
|
||||
# Build a NixOS system that is an installation ISO with SSH enabled and bcachefs
|
||||
# nix build .\#packages.x86_64-linux.iso-minimal-stable
|
||||
minimal =
|
||||
{ nixpkgs, system }:
|
||||
nixpkgs.lib.nixosSystem {
|
||||
|
|
@ -50,6 +51,18 @@
|
|||
# Required as a workaround for bug
|
||||
# https://github.com/NixOS/nixpkgs/issues/32279
|
||||
keyutils
|
||||
|
||||
(pkgs.writeShellScriptBin "speedtest_fs" ''
|
||||
dir=''$(pwd)
|
||||
drive=$(df -h ''${dir} | awk 'NR==2 {print $1}')
|
||||
echo Testing read speeds on drive ''${drive}
|
||||
sudo hdparm -Tt ''${drive}
|
||||
test_file=''$(date +%u%m%d)
|
||||
test_file="''${dir}/speedtest_fs_''${test_file}"
|
||||
echo
|
||||
echo Testing write speeds into test file: ''${test_file}
|
||||
dd if=/dev/zero of=''${test_file} bs=8k count=10k; rm -f ''${test_file}
|
||||
'')
|
||||
];
|
||||
boot.supportedFilesystems = [ "bcachefs" ];
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue