add speedtest filesystem helper

This commit is contained in:
RingOfStorms (Joshua Bell) 2025-12-18 13:00:25 -06:00
parent 222de09642
commit ea9340a612
2 changed files with 17 additions and 4 deletions

View file

@ -982,16 +982,16 @@
},
"stable": {
"locked": {
"lastModified": 1764939437,
"narHash": "sha256-4TLFHUwXraw9Df5mXC/vCrJgb50CRr3CzUzF0Mn3CII=",
"lastModified": 1765838191,
"narHash": "sha256-m5KWt1nOm76ILk/JSCxBM4MfK3rYY7Wq9/TZIIeGnT8=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "00d2457e2f608b4be6fe8b470b0a36816324b0ae",
"rev": "c6f52ebd45e5925c188d1a20119978aa4ffd5ef6",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-25.05",
"ref": "nixos-25.11",
"repo": "nixpkgs",
"type": "github"
}

View file

@ -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" ];