mirror of
https://git.sr.ht/~magic_rb/dotfiles
synced 2024-11-21 23:54:22 +01:00
Add a ~s0ix~ test script to the ~liveusb~ system
Signed-off-by: Magic_RB <magic_rb@redalder.org>
This commit is contained in:
parent
36120abf6b
commit
5f9b37a2ca
|
@ -29,6 +29,32 @@ in
|
|||
../../common/nixpkgs.nix
|
||||
];
|
||||
|
||||
environment.systemPackages = [
|
||||
(pkgs.writeShellScriptBin "test-s0ix" ''
|
||||
_cpu_residency="/sys/devices/system/cpu/cpuidle/low_power_idle_cpu_residency_us"
|
||||
_system_residency="/sys/devices/system/cpu/cpuidle/low_power_idle_system_residency_us"
|
||||
|
||||
echo '> '"$_system_residency before"
|
||||
_residency_before=$(cat "$_system_residency")
|
||||
echo "$_residency_before"
|
||||
|
||||
echo "Suspending to RAM and resuming in 30 seconds..."
|
||||
rtcwake -u -s 30 -m mem -n && systemctl suspend
|
||||
|
||||
echo '> '"$_system_residency after"
|
||||
_residency_after=$(cat "$_system_residency")
|
||||
echo "$_residency_after"
|
||||
|
||||
if [ $_residency_before -lt $_residency_after ] ; then
|
||||
echo "Suspend successful"
|
||||
elso
|
||||
echo "Suspend unsuccessful"
|
||||
fi
|
||||
|
||||
${lib'.getExe pkgs.smartmontools} -a $(echo /dev/nvme?n? | tr ' ' '\n' | head -n 1)
|
||||
'')
|
||||
];
|
||||
|
||||
isoImage.edition = "xfce";
|
||||
|
||||
services.xserver.videoDrivers = [ "nvidia" ];
|
||||
|
|
Loading…
Reference in a new issue