mirror of
https://github.com/buckley310/nixos-config.git
synced 2024-12-21 19:24:15 +00:00
add zram-ratio script
This commit is contained in:
parent
7f99d68036
commit
98ec7d6d68
1 changed files with 8 additions and 0 deletions
|
@ -45,6 +45,14 @@
|
||||||
|
|
||||||
(writeShellScriptBin "pip-install" "exec python -m ensurepip --user")
|
(writeShellScriptBin "pip-install" "exec python -m ensurepip --user")
|
||||||
|
|
||||||
|
(writeScriptBin "zram-ratio" ''
|
||||||
|
#!${pkgs.python3}/bin/python
|
||||||
|
(orig_data_size, compr_data_size, mem_used_total)=list(
|
||||||
|
map(int,filter(None,open('/sys/block/zram0/mm_stat').read().split(' ')))
|
||||||
|
)[:3]
|
||||||
|
print("compression ratio:", orig_data_size/mem_used_total)
|
||||||
|
'')
|
||||||
|
|
||||||
(writeShellScriptBin "nixos-check-reboot" ''
|
(writeShellScriptBin "nixos-check-reboot" ''
|
||||||
set -e
|
set -e
|
||||||
booted="$(readlink /run/booted-system/kernel)"
|
booted="$(readlink /run/booted-system/kernel)"
|
||||||
|
|
Loading…
Reference in a new issue