move reflac and disk-smart-test to overlays.nix

This commit is contained in:
Simon Gardling 2025-08-18 04:31:05 -04:00
parent 01a6ebcba6
commit 125c8a685e
Signed by: titaniumtown
GPG Key ID: 9AB28AC10ECE533D
2 changed files with 41 additions and 38 deletions

View File

@ -174,44 +174,8 @@
lsof
(pkgs.writeShellApplication {
name = "disk-smart-test";
runtimeInputs = with pkgs; [
gnugrep
coreutils
smartmontools
];
text = ''
#!/bin/sh
set -e
if [[ $EUID -ne 0 ]]; then
echo "This command requires root."
exit 2
fi
for i in /dev/disk/by-id/*; do
case "$i" in
*\\-part[0-9]*) continue ;;
esac
echo -n "$i "
smartctl -a "$i" | grep "SMART overall-health self-assessment test result:" | cut -d' ' -f6
done
'';
})
(pkgs.writeShellApplication {
name = "reflac";
runtimeInputs = with pkgs; [ flac ];
excludeShellChecks = [ "2086" ];
text = builtins.readFile (
pkgs.fetchurl {
url = "https://raw.githubusercontent.com/chungy/reflac/refs/heads/master/reflac";
sha256 = "61c6cc8be3d276c6714e68b55e5de0e6491f50bbf195233073dbce14a1e278a7";
}
);
})
disk-smart-test
reflac
pfetch-rs

View File

@ -30,4 +30,43 @@ final: prev: {
fi
'';
};
disk-smart-test = prev.writeShellApplication {
name = "disk-smart-test";
runtimeInputs = with prev; [
gnugrep
coreutils
smartmontools
];
text = ''
#!/bin/sh
set -e
if [[ $EUID -ne 0 ]]; then
echo "This command requires root."
exit 2
fi
for i in /dev/disk/by-id/*; do
case "$i" in
*\\-part[0-9]*) continue ;;
esac
echo -n "$i "
smartctl -a "$i" | grep "SMART overall-health self-assessment test result:" | cut -d' ' -f6
done
'';
};
reflac = prev.writeShellApplication {
name = "reflac";
runtimeInputs = with prev; [ flac ];
excludeShellChecks = [ "2086" ];
text = builtins.readFile (
prev.fetchurl {
url = "https://raw.githubusercontent.com/chungy/reflac/refs/heads/master/reflac";
sha256 = "61c6cc8be3d276c6714e68b55e5de0e6491f50bbf195233073dbce14a1e278a7";
}
);
};
}